<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Doxygen: recognition/include/pcl/recognition/3rdparty/metslib/model.hh 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Doxygen
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('model_8hh_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">model.hh</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">// METSlib source file - model.hh                                -*- C++ -*-</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Software License Agreement (BSD License)</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> *  Copyright (c) 2006-2012, Mirko Maischberger &lt;mirko.maischberger@gmail.com&gt;</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> *  All rights reserved.</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> *  Redistribution and use in source and binary forms, with or without</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *  modification, are permitted provided that the following conditions</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> *  are met:</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *   * Redistributions of source code must retain the above copyright</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> *     notice, this list of conditions and the following disclaimer.</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> *   * Redistributions in binary form must reproduce the above</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> *     copyright notice, this list of conditions and the following</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> *     disclaimer in the documentation and/or other materials provided</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> *     with the distribution.</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> *  &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment"> *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"> *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment"> *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment"> *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment"> *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment"> *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment"> *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="comment"> *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment"> *  POSSIBILITY OF SUCH DAMAGE.</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160; </div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#ifndef METS_MODEL_HH_</span></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#define METS_MODEL_HH_</span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160; </div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="keyword">namespace </span>mets {</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160; </div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;  <span class="keyword">typedef</span> <span class="keywordtype">double</span> gol_type;</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160; </div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="classmets_1_1no__moves__error.html">   49</a></span>&#160;  <span class="keyword">class </span><a class="code" href="classmets_1_1no__moves__error.html">no_moves_error</a> </div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    : <span class="keyword">public</span> std::runtime_error</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;  {</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <a class="code" href="classmets_1_1no__moves__error.html">no_moves_error</a>() </div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;      : std::runtime_error(<span class="stringliteral">&quot;There are no more available moves.&quot;</span>) {}</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    <a class="code" href="classmets_1_1no__moves__error.html">no_moves_error</a>(<span class="keyword">const</span> std::string message) </div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;      : std::runtime_error(message) {}</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;  };</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160; </div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="classmets_1_1sequence.html">   63</a></span>&#160;  <span class="keyword">class </span><a class="code" href="classmets_1_1sequence.html">sequence</a></div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;  {</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="classmets_1_1sequence.html#a14177f4a3aa54c1611747ab44356307a">   67</a></span>&#160;    <a class="code" href="classmets_1_1sequence.html#a14177f4a3aa54c1611747ab44356307a">sequence</a>(<span class="keywordtype">int</span> start = 0) </div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;      : value_m(start) </div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    { }</div>
<div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="classmets_1_1sequence.html#a8f6e2b7ee95d0c3295ac55e83c68d945">   72</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classmets_1_1sequence.html#a8f6e2b7ee95d0c3295ac55e83c68d945">operator()</a>() </div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    { <span class="keywordflow">return</span> value_m++; }</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;  <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keywordtype">int</span> value_m;</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;  };</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160; </div>
<div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="classmets_1_1clonable.html">   79</a></span>&#160;  <span class="keyword">class </span><a class="code" href="classmets_1_1clonable.html">clonable</a> {</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    <span class="keyword">virtual</span> </div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    ~<a class="code" href="classmets_1_1clonable.html">clonable</a>() {};</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    <span class="keyword">virtual</span> <a class="code" href="classmets_1_1clonable.html">clonable</a>* </div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    clone() <span class="keyword">const</span> = 0;</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;  };</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160; </div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="classmets_1_1hashable.html">   88</a></span>&#160;  <span class="keyword">class </span><a class="code" href="classmets_1_1hashable.html">hashable</a> {</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    <span class="keyword">virtual</span> </div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    ~<a class="code" href="classmets_1_1hashable.html">hashable</a>() {};</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> </div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    hash() <span class="keyword">const</span> = 0;</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;  };</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160; </div>
<div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="classmets_1_1copyable.html">   97</a></span>&#160;  <span class="keyword">class </span><a class="code" href="classmets_1_1copyable.html">copyable</a> {</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <span class="keyword">virtual</span> </div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    ~<a class="code" href="classmets_1_1copyable.html">copyable</a>() {};</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> </div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    copy_from(<span class="keyword">const</span> <a class="code" href="classmets_1_1copyable.html">copyable</a>&amp;) = 0;</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;  };</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160; </div>
<div class="line"><a name="l00106"></a><span class="lineno"><a class="line" href="classmets_1_1printable.html">  106</a></span>&#160;  <span class="keyword">class </span><a class="code" href="classmets_1_1printable.html">printable</a> {</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <span class="keyword">virtual</span> </div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    ~<a class="code" href="classmets_1_1printable.html">printable</a>() {}</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> </div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    print(std::ostream&amp; <span class="comment">/*os*/</span>)<span class="keyword"> const </span>{ };</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;  };</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160; </div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160; </div>
<div class="line"><a name="l00134"></a><span class="lineno"><a class="line" href="classmets_1_1feasible__solution.html">  134</a></span>&#160;  <span class="keyword">class </span><a class="code" href="classmets_1_1feasible__solution.html">feasible_solution</a></div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;  {</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    <span class="keyword">virtual</span></div>
<div class="line"><a name="l00139"></a><span class="lineno"><a class="line" href="classmets_1_1feasible__solution.html#ab15b3260d5e1eec2a79e103347ca788f">  139</a></span>&#160;    <a class="code" href="classmets_1_1feasible__solution.html#ab15b3260d5e1eec2a79e103347ca788f">~feasible_solution</a>() </div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    { }</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160; </div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;  };</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160; </div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160; </div>
<div class="line"><a name="l00155"></a><span class="lineno"><a class="line" href="classmets_1_1evaluable__solution.html">  155</a></span>&#160;  <span class="keyword">class </span><a class="code" href="classmets_1_1evaluable__solution.html">evaluable_solution</a> : <span class="keyword">public</span> <a class="code" href="classmets_1_1feasible__solution.html">feasible_solution</a>, </div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;                 <span class="keyword">public</span> <a class="code" href="classmets_1_1copyable.html">copyable</a></div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;  { </div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    <span class="keyword">virtual</span> gol_type </div>
<div class="line"><a name="l00167"></a><span class="lineno"><a class="line" href="classmets_1_1evaluable__solution.html#a9ef212cb6a07b57bf34d0af60deb6fad">  167</a></span>&#160;    <a class="code" href="classmets_1_1evaluable__solution.html#a9ef212cb6a07b57bf34d0af60deb6fad">cost_function</a>() <span class="keyword">const</span> = 0;</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;  };</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160; </div>
<div class="line"><a name="l00182"></a><span class="lineno"><a class="line" href="classmets_1_1permutation__problem.html">  182</a></span>&#160;  <span class="keyword">class </span><a class="code" href="classmets_1_1permutation__problem.html">permutation_problem</a>: <span class="keyword">public</span> <a class="code" href="classmets_1_1evaluable__solution.html">evaluable_solution</a> </div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;  {</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;    </div>
<div class="line"><a name="l00187"></a><span class="lineno"><a class="line" href="classmets_1_1permutation__problem.html#a8c23c755746873a10c81582bffb5d48b">  187</a></span>&#160;    <a class="code" href="classmets_1_1permutation__problem.html#a8c23c755746873a10c81582bffb5d48b">permutation_problem</a>(); </div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160; </div>
<div class="line"><a name="l00190"></a><span class="lineno"><a class="line" href="classmets_1_1permutation__problem.html#a8e8d83afe5be26c7000dafe31674efd5">  190</a></span>&#160;    <a class="code" href="classmets_1_1permutation__problem.html#a8e8d83afe5be26c7000dafe31674efd5">permutation_problem</a>(<span class="keywordtype">int</span> n) : pi_m(n), cost_m(0.0)</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    { std::generate(pi_m.begin(), pi_m.end(), <a class="code" href="classmets_1_1sequence.html">sequence</a>(0)); }</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160; </div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classmets_1_1permutation__problem.html#afb6ec1359a68d87ff2a3f1648c684b8a">copy_from</a>(<span class="keyword">const</span> <a class="code" href="classmets_1_1copyable.html">copyable</a>&amp; other);</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160; </div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;    <span class="keyword">virtual</span> gol_type</div>
<div class="line"><a name="l00204"></a><span class="lineno"><a class="line" href="classmets_1_1permutation__problem.html#a5ae9de2f07e547f9140f8b77ea9fc5bf">  204</a></span>&#160;    <a class="code" href="classmets_1_1permutation__problem.html#a5ae9de2f07e547f9140f8b77ea9fc5bf">compute_cost</a>() <span class="keyword">const</span> = 0;</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160; </div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;    <span class="keyword">virtual</span> gol_type</div>
<div class="line"><a name="l00218"></a><span class="lineno"><a class="line" href="classmets_1_1permutation__problem.html#a223eaad235680e4d4f3008ac7eeaeb82">  218</a></span>&#160;    <a class="code" href="classmets_1_1permutation__problem.html#a223eaad235680e4d4f3008ac7eeaeb82">evaluate_swap</a>(<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> j) <span class="keyword">const</span> = 0;</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160; </div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;    <span class="keywordtype">size_t</span> </div>
<div class="line"><a name="l00223"></a><span class="lineno"><a class="line" href="classmets_1_1permutation__problem.html#aa89b4d4809ec78d687d0537d833adc27">  223</a></span>&#160;    <a class="code" href="classmets_1_1permutation__problem.html#aa89b4d4809ec78d687d0537d833adc27">size</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;<span class="keyword">    </span>{ <span class="keywordflow">return</span> pi_m.size(); }</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160; </div>
<div class="line"><a name="l00230"></a><span class="lineno"><a class="line" href="classmets_1_1permutation__problem.html#a99eb2edeb0132b1c92bd146bda766b30">  230</a></span>&#160;    gol_type <a class="code" href="classmets_1_1permutation__problem.html#a99eb2edeb0132b1c92bd146bda766b30">cost_function</a>()<span class="keyword"> const </span></div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;<span class="keyword">    </span>{ <span class="keywordflow">return</span> cost_m; }</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160; </div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;    <span class="keywordtype">void</span></div>
<div class="line"><a name="l00236"></a><span class="lineno"><a class="line" href="classmets_1_1permutation__problem.html#a4dbc23d8f3e8e0fda5d085c75c87186c">  236</a></span>&#160;    <a class="code" href="classmets_1_1permutation__problem.html#a4dbc23d8f3e8e0fda5d085c75c87186c">update_cost</a>() </div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;    { cost_m = <a class="code" href="classmets_1_1permutation__problem.html#a5ae9de2f07e547f9140f8b77ea9fc5bf">compute_cost</a>(); }</div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;    </div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;    <span class="keywordtype">void</span></div>
<div class="line"><a name="l00242"></a><span class="lineno"><a class="line" href="classmets_1_1permutation__problem.html#a04b74de5cecfec914c53d5ff07129f3b">  242</a></span>&#160;    <a class="code" href="classmets_1_1permutation__problem.html#a04b74de5cecfec914c53d5ff07129f3b">apply_swap</a>(<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> j)</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;    { cost_m += <a class="code" href="classmets_1_1permutation__problem.html#a223eaad235680e4d4f3008ac7eeaeb82">evaluate_swap</a>(i,j); std::swap(pi_m[i], pi_m[j]); }</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;    </div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160; </div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;  <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;    std::vector&lt;int&gt; pi_m;</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;    gol_type cost_m;</div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> random_generator&gt; </div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;    <span class="keyword">friend</span> <span class="keywordtype">void</span> <a class="code" href="classmets_1_1permutation__problem.html#acb7ee40eabc97ada1f9d4d6cda486c66">random_shuffle</a>(<a class="code" href="classmets_1_1permutation__problem.html">permutation_problem</a>&amp; p, random_generator&amp; rng);</div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;  };</div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160; </div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160; </div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;  <span class="keyword">template</span>&lt;<span class="keyword">typename</span> random_generator&gt;</div>
<div class="line"><a name="l00258"></a><span class="lineno"><a class="line" href="classmets_1_1permutation__problem.html#acb7ee40eabc97ada1f9d4d6cda486c66">  258</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="group__model.html#gacfbb156f3953666fe3ee538ceb770f65">random_shuffle</a>(<a class="code" href="classmets_1_1permutation__problem.html">permutation_problem</a>&amp; p, random_generator&amp; rng)</div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;  {</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;<span class="preprocessor">#if defined (METSLIB_TR1_BOOST)</span></div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;    boost::uniform_int&lt;size_t&gt; unigen;</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;    boost::variate_generator&lt;random_generator&amp;,</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;      boost::uniform_int&lt;size_t&gt; &gt;gen(rng, unigen);</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;<span class="preprocessor">#elif defined (METSLIB_HAVE_UNORDERED_MAP) &amp;&amp; !defined (METSLIB_TR1_MIXED_NAMESPACE)</span></div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;    std::uniform_int&lt;size_t&gt; unigen;</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;    std::variate_generator&lt;random_generator&amp;, </div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;      std::uniform_int&lt;size_t&gt; &gt;gen(rng, unigen);</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;    std::tr1::uniform_int&lt;size_t&gt; unigen;</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;    std::tr1::variate_generator&lt;random_generator&amp;, </div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;      std::tr1::uniform_int&lt;size_t&gt; &gt;gen(rng, unigen);</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;    <a class="code" href="group__model.html#gacfbb156f3953666fe3ee538ceb770f65">std::random_shuffle</a>(p.pi_m.begin(), p.pi_m.end(), gen);</div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;    p.update_cost();</div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;  }</div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;  </div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;  <span class="keyword">template</span>&lt;<span class="keyword">typename</span> random_generator&gt;</div>
<div class="line"><a name="l00281"></a><span class="lineno"><a class="line" href="group__model.html#ga36dfb89bf6fb84702f7d021426b3f039">  281</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="group__model.html#ga36dfb89bf6fb84702f7d021426b3f039">perturbate</a>(<a class="code" href="classmets_1_1permutation__problem.html">permutation_problem</a>&amp; p, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> n, random_generator&amp; rng)</div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;  {</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;<span class="preprocessor">#if defined (METSLIB_TR1_BOOST)</span></div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;    boost::uniform_int&lt;&gt; int_range;</div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;<span class="preprocessor">#elif defined (METSLIB_HAVE_UNORDERED_MAP) &amp;&amp; !defined (METSLIB_TR1_MIXED_NAMESPACE)</span></div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;    std::uniform_int&lt;&gt; int_range;</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;    std::tr1::uniform_int&lt;&gt; int_range;</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;    <span class="keywordflow">for</span>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ii=0; ii!=n;++ii) </div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;      {</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;    <span class="keywordtype">int</span> p1 = int_range(rng, p.size());</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;    <span class="keywordtype">int</span> p2 = int_range(rng, p.size());</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;    <span class="keywordflow">while</span>(p1 == p2) </div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;      p2 = int_range(rng, p.size());</div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;    p.apply_swap(p1, p2);</div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;      }</div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;  }</div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;    </div>
<div class="line"><a name="l00309"></a><span class="lineno"><a class="line" href="classmets_1_1move.html">  309</a></span>&#160;  <span class="keyword">class </span><a class="code" href="classmets_1_1move.html">move</a></div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;  {</div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160; </div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;    <span class="keyword">virtual</span> </div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;    ~<a class="code" href="classmets_1_1move.html">move</a>() </div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;    { }; </div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160; </div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;    <span class="keyword">virtual</span> gol_type</div>
<div class="line"><a name="l00325"></a><span class="lineno"><a class="line" href="classmets_1_1move.html#a69c917e66e3f48d7df0136b6942a2476">  325</a></span>&#160;    <a class="code" href="classmets_1_1move.html#a69c917e66e3f48d7df0136b6942a2476">evaluate</a>(<span class="keyword">const</span> <a class="code" href="classmets_1_1feasible__solution.html">feasible_solution</a>&amp; sol) <span class="keyword">const</span> = 0;</div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160; </div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span></div>
<div class="line"><a name="l00332"></a><span class="lineno"><a class="line" href="classmets_1_1move.html#ae80d24a084cd9a3841007f1e88c5ea12">  332</a></span>&#160;    <a class="code" href="classmets_1_1move.html#ae80d24a084cd9a3841007f1e88c5ea12">apply</a>(<a class="code" href="classmets_1_1feasible__solution.html">feasible_solution</a>&amp; sol) <span class="keyword">const</span> = 0;</div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160; </div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160; </div>
<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;  };</div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160; </div>
<div class="line"><a name="l00351"></a><span class="lineno"><a class="line" href="classmets_1_1mana__move.html">  351</a></span>&#160;  <span class="keyword">class </span><a class="code" href="classmets_1_1mana__move.html">mana_move</a> : </div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;    <span class="keyword">public</span> <a class="code" href="classmets_1_1move.html">move</a>, </div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;    <span class="keyword">public</span> <a class="code" href="classmets_1_1clonable.html">clonable</a>, </div>
<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;    <span class="keyword">public</span> <a class="code" href="classmets_1_1hashable.html">hashable</a></div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;  {</div>
<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;    </div>
<div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;    <span class="keyword">virtual</span> <a class="code" href="classmets_1_1mana__move.html">mana_move</a>*</div>
<div class="line"><a name="l00367"></a><span class="lineno"><a class="line" href="classmets_1_1mana__move.html#a0faf5590c15ae4ed13470033fb7ed000">  367</a></span>&#160;    <a class="code" href="classmets_1_1mana__move.html#a0faf5590c15ae4ed13470033fb7ed000">opposite_of</a>()<span class="keyword"> const </span></div>
<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;<span class="keyword">    </span>{ <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><a class="code" href="classmets_1_1mana__move.html">mana_move</a>*<span class="keyword">&gt;</span>(clone()); }</div>
<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;    </div>
<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> </div>
<div class="line"><a name="l00373"></a><span class="lineno"><a class="line" href="classmets_1_1mana__move.html#a7ff17d8c4ffa899dc3ba7279e7e829c0">  373</a></span>&#160;    <a class="code" href="classmets_1_1mana__move.html#a7ff17d8c4ffa899dc3ba7279e7e829c0">operator==</a>(<span class="keyword">const</span> <a class="code" href="classmets_1_1mana__move.html">mana_move</a>&amp; other) <span class="keyword">const</span> = 0;</div>
<div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;    </div>
<div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;  };</div>
<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160; </div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;  <span class="keyword">template</span>&lt;<span class="keyword">typename</span> rndgen&gt; <span class="keyword">class </span><a class="code" href="classmets_1_1swap__neighborhood.html">swap_neighborhood</a>; <span class="comment">// fw decl</span></div>
<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160; </div>
<div class="line"><a name="l00386"></a><span class="lineno"><a class="line" href="classmets_1_1swap__elements.html">  386</a></span>&#160;  <span class="keyword">class </span><a class="code" href="classmets_1_1swap__elements.html">swap_elements</a> : <span class="keyword">public</span> <a class="code" href="classmets_1_1mana__move.html">mets::mana_move</a> </div>
<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;  {</div>
<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;  <span class="keyword">public</span>:  </div>
<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160; </div>
<div class="line"><a name="l00391"></a><span class="lineno"><a class="line" href="classmets_1_1swap__elements.html#a9d045674248a1409743b3fa558391a6a">  391</a></span>&#160;    <a class="code" href="classmets_1_1swap__elements.html#a9d045674248a1409743b3fa558391a6a">swap_elements</a>(<span class="keywordtype">int</span> from, <span class="keywordtype">int</span> to) </div>
<div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;      : <a class="code" href="classmets_1_1swap__elements.html#ad0b091837bf8081d2288a354b1cdb88e">p1</a>(std::min(from,to)), <a class="code" href="classmets_1_1swap__elements.html#af363135d28b4924d8b5efc48d7d2cffc">p2</a>(std::max(from,to)) </div>
<div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;    { }</div>
<div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;    </div>
<div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;    gol_type</div>
<div class="line"><a name="l00397"></a><span class="lineno"><a class="line" href="classmets_1_1swap__elements.html#abc881d41079ab026f69411a05db183e2">  397</a></span>&#160;    <a class="code" href="classmets_1_1swap__elements.html#abc881d41079ab026f69411a05db183e2">evaluate</a>(<span class="keyword">const</span> <a class="code" href="classmets_1_1feasible__solution.html">mets::feasible_solution</a>&amp; s)<span class="keyword"> const</span></div>
<div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160;<span class="keyword">    </span>{ <span class="keyword">const</span> <a class="code" href="classmets_1_1permutation__problem.html">permutation_problem</a>&amp; sol = </div>
<div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;    <span class="keyword">static_cast&lt;</span><span class="keyword">const </span><a class="code" href="classmets_1_1permutation__problem.html">permutation_problem</a>&amp;<span class="keyword">&gt;</span>(s);</div>
<div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;      <span class="keywordflow">return</span> sol.<a class="code" href="classmets_1_1permutation__problem.html#a99eb2edeb0132b1c92bd146bda766b30">cost_function</a>() + sol.<a class="code" href="classmets_1_1permutation__problem.html#a223eaad235680e4d4f3008ac7eeaeb82">evaluate_swap</a>(<a class="code" href="classmets_1_1swap__elements.html#ad0b091837bf8081d2288a354b1cdb88e">p1</a>, <a class="code" href="classmets_1_1swap__elements.html#af363135d28b4924d8b5efc48d7d2cffc">p2</a>); }</div>
<div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;    </div>
<div class="line"><a name="l00403"></a><span class="lineno">  403</span>&#160;    <span class="keywordtype">void</span></div>
<div class="line"><a name="l00404"></a><span class="lineno"><a class="line" href="classmets_1_1swap__elements.html#a2dc625e7f5b1557c118f79e7ac521485">  404</a></span>&#160;    <a class="code" href="classmets_1_1swap__elements.html#a2dc625e7f5b1557c118f79e7ac521485">apply</a>(<a class="code" href="classmets_1_1feasible__solution.html">mets::feasible_solution</a>&amp; s)<span class="keyword"> const</span></div>
<div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;<span class="keyword">    </span>{ <a class="code" href="classmets_1_1permutation__problem.html">permutation_problem</a>&amp; sol = <span class="keyword">static_cast&lt;</span><a class="code" href="classmets_1_1permutation__problem.html">permutation_problem</a>&amp;<span class="keyword">&gt;</span>(s);</div>
<div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160;      sol.<a class="code" href="classmets_1_1permutation__problem.html#a04b74de5cecfec914c53d5ff07129f3b">apply_swap</a>(<a class="code" href="classmets_1_1swap__elements.html#ad0b091837bf8081d2288a354b1cdb88e">p1</a>, <a class="code" href="classmets_1_1swap__elements.html#af363135d28b4924d8b5efc48d7d2cffc">p2</a>); }</div>
<div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;            </div>
<div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;    <a class="code" href="classmets_1_1clonable.html">clonable</a>* </div>
<div class="line"><a name="l00410"></a><span class="lineno"><a class="line" href="classmets_1_1swap__elements.html#a8bf3daa4735c34a3f0947ae186b18083">  410</a></span>&#160;    <a class="code" href="classmets_1_1swap__elements.html#a8bf3daa4735c34a3f0947ae186b18083">clone</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;<span class="keyword">    </span>{ <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classmets_1_1swap__elements.html#a9d045674248a1409743b3fa558391a6a">swap_elements</a>(<a class="code" href="classmets_1_1swap__elements.html#ad0b091837bf8081d2288a354b1cdb88e">p1</a>, <a class="code" href="classmets_1_1swap__elements.html#af363135d28b4924d8b5efc48d7d2cffc">p2</a>); }</div>
<div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160; </div>
<div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;    <span class="keywordtype">size_t</span></div>
<div class="line"><a name="l00416"></a><span class="lineno"><a class="line" href="classmets_1_1swap__elements.html#a45079b62befcdaa317e3942ad1756960">  416</a></span>&#160;    <a class="code" href="classmets_1_1swap__elements.html#a45079b62befcdaa317e3942ad1756960">hash</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;<span class="keyword">    </span>{ <span class="keywordflow">return</span> (<a class="code" href="classmets_1_1swap__elements.html#ad0b091837bf8081d2288a354b1cdb88e">p1</a>)&lt;&lt;16^(<a class="code" href="classmets_1_1swap__elements.html#af363135d28b4924d8b5efc48d7d2cffc">p2</a>); }</div>
<div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;    </div>
<div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;    <span class="keywordtype">bool</span> </div>
<div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;    <a class="code" href="classmets_1_1swap__elements.html#ae6262642f3c5802d86fc2b4dc5d2ad6b">operator==</a>(<span class="keyword">const</span> <a class="code" href="classmets_1_1mana__move.html">mets::mana_move</a>&amp; o) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160;    </div>
<div class="line"><a name="l00425"></a><span class="lineno"><a class="line" href="classmets_1_1swap__elements.html#a0f4f4e09d0bbd6f282eb433844ecc5a0">  425</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classmets_1_1swap__elements.html#a0f4f4e09d0bbd6f282eb433844ecc5a0">change</a>(<span class="keywordtype">int</span> from, <span class="keywordtype">int</span> to)</div>
<div class="line"><a name="l00426"></a><span class="lineno">  426</span>&#160;    { <a class="code" href="classmets_1_1swap__elements.html#ad0b091837bf8081d2288a354b1cdb88e">p1</a> = std::min(from,to); <a class="code" href="classmets_1_1swap__elements.html#af363135d28b4924d8b5efc48d7d2cffc">p2</a> = std::max(from,to); }</div>
<div class="line"><a name="l00427"></a><span class="lineno">  427</span>&#160; </div>
<div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;  <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00429"></a><span class="lineno"><a class="line" href="classmets_1_1swap__elements.html#ad0b091837bf8081d2288a354b1cdb88e">  429</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classmets_1_1swap__elements.html#ad0b091837bf8081d2288a354b1cdb88e">p1</a>; </div>
<div class="line"><a name="l00430"></a><span class="lineno"><a class="line" href="classmets_1_1swap__elements.html#af363135d28b4924d8b5efc48d7d2cffc">  430</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classmets_1_1swap__elements.html#af363135d28b4924d8b5efc48d7d2cffc">p2</a>; </div>
<div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160; </div>
<div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span>&gt; </div>
<div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;    <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classmets_1_1swap__neighborhood.html">swap_neighborhood</a>;</div>
<div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;  };</div>
<div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160; </div>
<div class="line"><a name="l00441"></a><span class="lineno"><a class="line" href="classmets_1_1invert__subsequence.html">  441</a></span>&#160;  <span class="keyword">class </span><a class="code" href="classmets_1_1invert__subsequence.html">invert_subsequence</a> : <span class="keyword">public</span> <a class="code" href="classmets_1_1mana__move.html">mets::mana_move</a> </div>
<div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160;  {</div>
<div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160;  <span class="keyword">public</span>:  </div>
<div class="line"><a name="l00444"></a><span class="lineno">  444</span>&#160; </div>
<div class="line"><a name="l00446"></a><span class="lineno"><a class="line" href="classmets_1_1invert__subsequence.html#a1e4a701e9c5aa341079f88b7df86c560">  446</a></span>&#160;    <a class="code" href="classmets_1_1invert__subsequence.html#a1e4a701e9c5aa341079f88b7df86c560">invert_subsequence</a>(<span class="keywordtype">int</span> from, <span class="keywordtype">int</span> to) </div>
<div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;      : <a class="code" href="classmets_1_1invert__subsequence.html#a7e032c3a48524ea28fca3cad2f09dd86">p1</a>(from), <a class="code" href="classmets_1_1invert__subsequence.html#ae971fa9cdc048e5bd34bd939e2f82de5">p2</a>(to) </div>
<div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160;    { }</div>
<div class="line"><a name="l00449"></a><span class="lineno">  449</span>&#160;    </div>
<div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;    gol_type</div>
<div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160;    <a class="code" href="classmets_1_1invert__subsequence.html#ad64ffab62633cc4b43903eb3bfe5e328">evaluate</a>(<span class="keyword">const</span> <a class="code" href="classmets_1_1feasible__solution.html">mets::feasible_solution</a>&amp; s) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160; </div>
<div class="line"><a name="l00455"></a><span class="lineno">  455</span>&#160;    <span class="keywordtype">void</span></div>
<div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160;    <a class="code" href="classmets_1_1invert__subsequence.html#ade3c72591bca9042b637fe99c51bc97b">apply</a>(<a class="code" href="classmets_1_1feasible__solution.html">mets::feasible_solution</a>&amp; s) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;        </div>
<div class="line"><a name="l00458"></a><span class="lineno">  458</span>&#160;    <a class="code" href="classmets_1_1clonable.html">clonable</a>* </div>
<div class="line"><a name="l00459"></a><span class="lineno">  459</span>&#160;    clone()<span class="keyword"> const</span></div>
<div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160;<span class="keyword">    </span>{ <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classmets_1_1invert__subsequence.html#a1e4a701e9c5aa341079f88b7df86c560">invert_subsequence</a>(<a class="code" href="classmets_1_1invert__subsequence.html#a7e032c3a48524ea28fca3cad2f09dd86">p1</a>, <a class="code" href="classmets_1_1invert__subsequence.html#ae971fa9cdc048e5bd34bd939e2f82de5">p2</a>); }</div>
<div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160; </div>
<div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160;    <span class="keywordtype">size_t</span></div>
<div class="line"><a name="l00465"></a><span class="lineno"><a class="line" href="classmets_1_1invert__subsequence.html#af5cc9c3af4ce11eab78cadffe4f81df1">  465</a></span>&#160;    <a class="code" href="classmets_1_1invert__subsequence.html#af5cc9c3af4ce11eab78cadffe4f81df1">hash</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00466"></a><span class="lineno">  466</span>&#160;<span class="keyword">    </span>{ <span class="keywordflow">return</span> (<a class="code" href="classmets_1_1invert__subsequence.html#a7e032c3a48524ea28fca3cad2f09dd86">p1</a>)&lt;&lt;16^(<a class="code" href="classmets_1_1invert__subsequence.html#ae971fa9cdc048e5bd34bd939e2f82de5">p2</a>); }</div>
<div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;    </div>
<div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;    <span class="keywordtype">bool</span> </div>
<div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;    <a class="code" href="classmets_1_1invert__subsequence.html#a75cbeca37763195489db7c26a7045305">operator==</a>(<span class="keyword">const</span> <a class="code" href="classmets_1_1mana__move.html">mets::mana_move</a>&amp; o) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;    </div>
<div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160;    <span class="keywordtype">void</span> change(<span class="keywordtype">int</span> from, <span class="keywordtype">int</span> to)</div>
<div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160;    { <a class="code" href="classmets_1_1invert__subsequence.html#a7e032c3a48524ea28fca3cad2f09dd86">p1</a> = from; <a class="code" href="classmets_1_1invert__subsequence.html#ae971fa9cdc048e5bd34bd939e2f82de5">p2</a> = to; }</div>
<div class="line"><a name="l00475"></a><span class="lineno">  475</span>&#160;    </div>
<div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;  <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00477"></a><span class="lineno"><a class="line" href="classmets_1_1invert__subsequence.html#a7e032c3a48524ea28fca3cad2f09dd86">  477</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classmets_1_1invert__subsequence.html#a7e032c3a48524ea28fca3cad2f09dd86">p1</a>; </div>
<div class="line"><a name="l00478"></a><span class="lineno"><a class="line" href="classmets_1_1invert__subsequence.html#ae971fa9cdc048e5bd34bd939e2f82de5">  478</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classmets_1_1invert__subsequence.html#ae971fa9cdc048e5bd34bd939e2f82de5">p2</a>; </div>
<div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;    </div>
<div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;    <span class="comment">// template &lt;typename&gt; </span></div>
<div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;    <span class="comment">// friend class invert_full_neighborhood;</span></div>
<div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;  };</div>
<div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160; </div>
<div class="line"><a name="l00507"></a><span class="lineno"><a class="line" href="classmets_1_1move__manager.html">  507</a></span>&#160;  <span class="keyword">class </span><a class="code" href="classmets_1_1move__manager.html">move_manager</a></div>
<div class="line"><a name="l00508"></a><span class="lineno">  508</span>&#160;  {</div>
<div class="line"><a name="l00509"></a><span class="lineno">  509</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00512"></a><span class="lineno"><a class="line" href="classmets_1_1move__manager.html#a546406d667dc0d50b5e96ba9f26df457">  512</a></span>&#160;    <a class="code" href="classmets_1_1move__manager.html#a546406d667dc0d50b5e96ba9f26df457">move_manager</a>() </div>
<div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160;      : <a class="code" href="classmets_1_1move__manager.html#a764ca3061b1f019b5508fc03323fd501">moves_m</a>() </div>
<div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160;    { }</div>
<div class="line"><a name="l00515"></a><span class="lineno">  515</span>&#160; </div>
<div class="line"><a name="l00517"></a><span class="lineno"><a class="line" href="classmets_1_1move__manager.html#a8043a2af47c32cd18d49549cc3075f26">  517</a></span>&#160;    <span class="keyword">virtual</span> <a class="code" href="classmets_1_1move__manager.html#a8043a2af47c32cd18d49549cc3075f26">~move_manager</a>() </div>
<div class="line"><a name="l00518"></a><span class="lineno">  518</span>&#160;    { }</div>
<div class="line"><a name="l00519"></a><span class="lineno">  519</span>&#160; </div>
<div class="line"><a name="l00521"></a><span class="lineno">  521</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> </div>
<div class="line"><a name="l00522"></a><span class="lineno"><a class="line" href="classmets_1_1move__manager.html#ab88fc9c9029575bf715a9d8563e77e62">  522</a></span>&#160;    <a class="code" href="classmets_1_1move__manager.html#ab88fc9c9029575bf715a9d8563e77e62">refresh</a>(<a class="code" href="classmets_1_1feasible__solution.html">mets::feasible_solution</a>&amp; s) = 0;</div>
<div class="line"><a name="l00523"></a><span class="lineno">  523</span>&#160;    </div>
<div class="line"><a name="l00525"></a><span class="lineno"><a class="line" href="classmets_1_1move__manager.html#aeefc958bebc97fe6b61ce19c0ef37f1c">  525</a></span>&#160;    <span class="keyword">typedef</span> std::deque&lt;move*&gt;::iterator <a class="code" href="classmets_1_1move__manager.html#aeefc958bebc97fe6b61ce19c0ef37f1c">iterator</a>;</div>
<div class="line"><a name="l00526"></a><span class="lineno">  526</span>&#160;    </div>
<div class="line"><a name="l00528"></a><span class="lineno"><a class="line" href="classmets_1_1move__manager.html#afa4c4ed8f7f06f5b71d9bef68c11b36d">  528</a></span>&#160;    <span class="keyword">typedef</span> std::deque&lt;move*&gt;::size_type <a class="code" href="classmets_1_1move__manager.html#afa4c4ed8f7f06f5b71d9bef68c11b36d">size_type</a>;</div>
<div class="line"><a name="l00529"></a><span class="lineno">  529</span>&#160; </div>
<div class="line"><a name="l00531"></a><span class="lineno"><a class="line" href="classmets_1_1move__manager.html#a27ab567f8a638f5d6db4b39c452c8b31">  531</a></span>&#160;    <a class="code" href="classmets_1_1move__manager.html#aeefc958bebc97fe6b61ce19c0ef37f1c">iterator</a> <a class="code" href="classmets_1_1move__manager.html#a27ab567f8a638f5d6db4b39c452c8b31">begin</a>() </div>
<div class="line"><a name="l00532"></a><span class="lineno">  532</span>&#160;    { <span class="keywordflow">return</span> <a class="code" href="classmets_1_1move__manager.html#a764ca3061b1f019b5508fc03323fd501">moves_m</a>.begin(); }</div>
<div class="line"><a name="l00533"></a><span class="lineno">  533</span>&#160; </div>
<div class="line"><a name="l00535"></a><span class="lineno"><a class="line" href="classmets_1_1move__manager.html#a1418389c4f7b900ab3ca9d211b6cf9b5">  535</a></span>&#160;    <a class="code" href="classmets_1_1move__manager.html#aeefc958bebc97fe6b61ce19c0ef37f1c">iterator</a> <a class="code" href="classmets_1_1move__manager.html#a1418389c4f7b900ab3ca9d211b6cf9b5">end</a>() </div>
<div class="line"><a name="l00536"></a><span class="lineno">  536</span>&#160;    { <span class="keywordflow">return</span> <a class="code" href="classmets_1_1move__manager.html#a764ca3061b1f019b5508fc03323fd501">moves_m</a>.end(); }</div>
<div class="line"><a name="l00537"></a><span class="lineno">  537</span>&#160; </div>
<div class="line"><a name="l00539"></a><span class="lineno"><a class="line" href="classmets_1_1move__manager.html#a07f46fd5f66246612d7595e78329f6d2">  539</a></span>&#160;    <a class="code" href="classmets_1_1move__manager.html#afa4c4ed8f7f06f5b71d9bef68c11b36d">size_type</a> <a class="code" href="classmets_1_1move__manager.html#a07f46fd5f66246612d7595e78329f6d2">size</a>()<span class="keyword"> const </span></div>
<div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;<span class="keyword">    </span>{ <span class="keywordflow">return</span> <a class="code" href="classmets_1_1move__manager.html#a764ca3061b1f019b5508fc03323fd501">moves_m</a>.size(); }</div>
<div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160; </div>
<div class="line"><a name="l00542"></a><span class="lineno">  542</span>&#160;  <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00543"></a><span class="lineno"><a class="line" href="classmets_1_1move__manager.html#a764ca3061b1f019b5508fc03323fd501">  543</a></span>&#160;    std::deque&lt;move*&gt; <a class="code" href="classmets_1_1move__manager.html#a764ca3061b1f019b5508fc03323fd501">moves_m</a>; </div>
<div class="line"><a name="l00544"></a><span class="lineno">  544</span>&#160;    <a class="code" href="classmets_1_1move__manager.html#a546406d667dc0d50b5e96ba9f26df457">move_manager</a>(<span class="keyword">const</span> <a class="code" href="classmets_1_1move__manager.html">move_manager</a>&amp;);</div>
<div class="line"><a name="l00545"></a><span class="lineno">  545</span>&#160;  };</div>
<div class="line"><a name="l00546"></a><span class="lineno">  546</span>&#160;  </div>
<div class="line"><a name="l00547"></a><span class="lineno">  547</span>&#160; </div>
<div class="line"><a name="l00549"></a><span class="lineno">  549</span>&#160;<span class="preprocessor">#if defined (METSLIB_TR1_BOOST)</span></div>
<div class="line"><a name="l00550"></a><span class="lineno">  550</span>&#160;  <span class="keyword">template</span>&lt;<span class="keyword">typename</span> random_generator = boost::minstd_rand0&gt;</div>
<div class="line"><a name="l00551"></a><span class="lineno">  551</span>&#160;<span class="preprocessor">#elif defined (METSLIB_HAVE_UNORDERED_MAP) &amp;&amp; !defined (METSLIB_TR1_MIXED_NAMESPACE)</span></div>
<div class="line"><a name="l00552"></a><span class="lineno">  552</span>&#160;  <span class="keyword">template</span>&lt;<span class="keyword">typename</span> random_generator = std::minstd_rand0&gt;</div>
<div class="line"><a name="l00553"></a><span class="lineno">  553</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00554"></a><span class="lineno">  554</span>&#160;  <span class="keyword">template</span>&lt;<span class="keyword">typename</span> random_generator = std::tr1::minstd_rand0&gt;</div>
<div class="line"><a name="l00555"></a><span class="lineno">  555</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00556"></a><span class="lineno"><a class="line" href="classmets_1_1swap__neighborhood.html">  556</a></span>&#160;  <span class="keyword">class </span><a class="code" href="classmets_1_1swap__neighborhood.html">swap_neighborhood</a> : <span class="keyword">public</span> <a class="code" href="classmets_1_1move__manager.html">mets::move_manager</a></div>
<div class="line"><a name="l00557"></a><span class="lineno">  557</span>&#160;  {</div>
<div class="line"><a name="l00558"></a><span class="lineno">  558</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00568"></a><span class="lineno">  568</span>&#160;    <a class="code" href="group__model.html#gadf750e2f7c7ff73f7d3e3d9bedc3e417">swap_neighborhood</a>(random_generator&amp; r, </div>
<div class="line"><a name="l00569"></a><span class="lineno">  569</span>&#160;              <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> moves);</div>
<div class="line"><a name="l00570"></a><span class="lineno">  570</span>&#160; </div>
<div class="line"><a name="l00572"></a><span class="lineno">  572</span>&#160;    <a class="code" href="group__model.html#ga5bb7936b6ad1ff51e8574996f77d457f">~swap_neighborhood</a>();</div>
<div class="line"><a name="l00573"></a><span class="lineno">  573</span>&#160; </div>
<div class="line"><a name="l00575"></a><span class="lineno">  575</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="group__model.html#ga9ece6da99a38121877de3e4f6c36293c">refresh</a>(<a class="code" href="classmets_1_1feasible__solution.html">mets::feasible_solution</a>&amp; s);</div>
<div class="line"><a name="l00576"></a><span class="lineno">  576</span>&#160;    </div>
<div class="line"><a name="l00577"></a><span class="lineno">  577</span>&#160;  <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00578"></a><span class="lineno">  578</span>&#160;    random_generator&amp; rng;</div>
<div class="line"><a name="l00579"></a><span class="lineno">  579</span>&#160; </div>
<div class="line"><a name="l00580"></a><span class="lineno">  580</span>&#160;<span class="preprocessor">#if defined (METSLIB_TR1_BOOST)</span></div>
<div class="line"><a name="l00581"></a><span class="lineno">  581</span>&#160;    boost::uniform_int&lt;&gt; int_range;</div>
<div class="line"><a name="l00582"></a><span class="lineno">  582</span>&#160;<span class="preprocessor">#elif defined (METSLIB_HAVE_UNORDERED_MAP) &amp;&amp; !defined (METSLIB_TR1_MIXED_NAMESPACE)</span></div>
<div class="line"><a name="l00583"></a><span class="lineno">  583</span>&#160;    std::uniform_int&lt;&gt; int_range;</div>
<div class="line"><a name="l00584"></a><span class="lineno">  584</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00585"></a><span class="lineno">  585</span>&#160;    std::tr1::uniform_int&lt;&gt; int_range;</div>
<div class="line"><a name="l00586"></a><span class="lineno">  586</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00587"></a><span class="lineno">  587</span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> n;</div>
<div class="line"><a name="l00588"></a><span class="lineno">  588</span>&#160; </div>
<div class="line"><a name="l00589"></a><span class="lineno">  589</span>&#160;    <span class="keywordtype">void</span> randomize_move(<a class="code" href="classmets_1_1swap__elements.html">swap_elements</a>&amp; m, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classmets_1_1move__manager.html#a07f46fd5f66246612d7595e78329f6d2">size</a>);</div>
<div class="line"><a name="l00590"></a><span class="lineno">  590</span>&#160;  };</div>
<div class="line"><a name="l00591"></a><span class="lineno">  591</span>&#160; </div>
<div class="line"><a name="l00592"></a><span class="lineno">  592</span>&#160;  <span class="comment">//________________________________________________________________________</span></div>
<div class="line"><a name="l00593"></a><span class="lineno">  593</span>&#160;  <span class="keyword">template</span>&lt;<span class="keyword">typename</span> random_generator&gt;</div>
<div class="line"><a name="l00594"></a><span class="lineno">  594</span>&#160;  <a class="code" href="classmets_1_1swap__neighborhood.html">mets::swap_neighborhood</a>&lt; random_generator</div>
<div class="line"><a name="l00595"></a><span class="lineno"><a class="line" href="group__model.html#gadf750e2f7c7ff73f7d3e3d9bedc3e417">  595</a></span>&#160;               &gt;<a class="code" href="classmets_1_1swap__neighborhood.html">::swap_neighborhood</a>(random_generator&amp; r, </div>
<div class="line"><a name="l00596"></a><span class="lineno">  596</span>&#160;                        <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> moves)</div>
<div class="line"><a name="l00597"></a><span class="lineno">  597</span>&#160;                 : mets::<a class="code" href="classmets_1_1move__manager.html">move_manager</a>(), rng(r), int_range(0), n(moves)</div>
<div class="line"><a name="l00598"></a><span class="lineno">  598</span>&#160;  { </div>
<div class="line"><a name="l00599"></a><span class="lineno">  599</span>&#160;    <span class="comment">// n simple moves</span></div>
<div class="line"><a name="l00600"></a><span class="lineno">  600</span>&#160;    <span class="keywordflow">for</span>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ii = 0; ii != n; ++ii) </div>
<div class="line"><a name="l00601"></a><span class="lineno">  601</span>&#160;      <a class="code" href="classmets_1_1move__manager.html#a764ca3061b1f019b5508fc03323fd501">moves_m</a>.push_back(<span class="keyword">new</span> <a class="code" href="classmets_1_1swap__elements.html">swap_elements</a>(0,0));</div>
<div class="line"><a name="l00602"></a><span class="lineno">  602</span>&#160;  }  </div>
<div class="line"><a name="l00603"></a><span class="lineno">  603</span>&#160;  </div>
<div class="line"><a name="l00604"></a><span class="lineno">  604</span>&#160;  <span class="keyword">template</span>&lt;<span class="keyword">typename</span> random_generator&gt;</div>
<div class="line"><a name="l00605"></a><span class="lineno"><a class="line" href="group__model.html#ga5bb7936b6ad1ff51e8574996f77d457f">  605</a></span>&#160;  <a class="code" href="group__model.html#ga5bb7936b6ad1ff51e8574996f77d457f">mets::swap_neighborhood&lt;random_generator&gt;::~swap_neighborhood</a>()</div>
<div class="line"><a name="l00606"></a><span class="lineno">  606</span>&#160;  {</div>
<div class="line"><a name="l00607"></a><span class="lineno">  607</span>&#160;    <span class="comment">// delete all moves</span></div>
<div class="line"><a name="l00608"></a><span class="lineno">  608</span>&#160;    <span class="keywordflow">for</span>(<a class="code" href="classmets_1_1move__manager.html#aeefc958bebc97fe6b61ce19c0ef37f1c">iterator</a> ii = begin(); ii != end(); ++ii)</div>
<div class="line"><a name="l00609"></a><span class="lineno">  609</span>&#160;      <span class="keyword">delete</span> (*ii);</div>
<div class="line"><a name="l00610"></a><span class="lineno">  610</span>&#160;  }</div>
<div class="line"><a name="l00611"></a><span class="lineno">  611</span>&#160; </div>
<div class="line"><a name="l00612"></a><span class="lineno">  612</span>&#160;  <span class="keyword">template</span>&lt;<span class="keyword">typename</span> random_generator&gt;</div>
<div class="line"><a name="l00613"></a><span class="lineno">  613</span>&#160;  <span class="keywordtype">void</span></div>
<div class="line"><a name="l00614"></a><span class="lineno"><a class="line" href="group__model.html#ga9ece6da99a38121877de3e4f6c36293c">  614</a></span>&#160;  <a class="code" href="group__model.html#ga9ece6da99a38121877de3e4f6c36293c">mets::swap_neighborhood&lt;random_generator&gt;::refresh</a>(<a class="code" href="classmets_1_1feasible__solution.html">mets::feasible_solution</a>&amp; s)</div>
<div class="line"><a name="l00615"></a><span class="lineno">  615</span>&#160;  {</div>
<div class="line"><a name="l00616"></a><span class="lineno">  616</span>&#160;    <a class="code" href="classmets_1_1permutation__problem.html">permutation_problem</a>&amp; sol = <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classmets_1_1permutation__problem.html">permutation_problem</a>&amp;<span class="keyword">&gt;</span>(s);</div>
<div class="line"><a name="l00617"></a><span class="lineno">  617</span>&#160;    <a class="code" href="classmets_1_1move__manager.html#aeefc958bebc97fe6b61ce19c0ef37f1c">iterator</a> ii = begin();</div>
<div class="line"><a name="l00618"></a><span class="lineno">  618</span>&#160;    </div>
<div class="line"><a name="l00619"></a><span class="lineno">  619</span>&#160;    <span class="comment">// the first n are simple qap_moveS</span></div>
<div class="line"><a name="l00620"></a><span class="lineno">  620</span>&#160;    <span class="keywordflow">for</span>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> cnt = 0; cnt != n; ++cnt)</div>
<div class="line"><a name="l00621"></a><span class="lineno">  621</span>&#160;      {</div>
<div class="line"><a name="l00622"></a><span class="lineno">  622</span>&#160;    <a class="code" href="classmets_1_1swap__elements.html">swap_elements</a>* m = <span class="keyword">static_cast&lt;</span><a class="code" href="classmets_1_1swap__elements.html">swap_elements</a>*<span class="keyword">&gt;</span>(*ii);</div>
<div class="line"><a name="l00623"></a><span class="lineno">  623</span>&#160;    randomize_move(*m, sol.<a class="code" href="classmets_1_1permutation__problem.html#aa89b4d4809ec78d687d0537d833adc27">size</a>());</div>
<div class="line"><a name="l00624"></a><span class="lineno">  624</span>&#160;    ++ii;</div>
<div class="line"><a name="l00625"></a><span class="lineno">  625</span>&#160;      }</div>
<div class="line"><a name="l00626"></a><span class="lineno">  626</span>&#160;    </div>
<div class="line"><a name="l00627"></a><span class="lineno">  627</span>&#160;  }</div>
<div class="line"><a name="l00628"></a><span class="lineno">  628</span>&#160;  </div>
<div class="line"><a name="l00629"></a><span class="lineno">  629</span>&#160;  <span class="keyword">template</span>&lt;<span class="keyword">typename</span> random_generator&gt;</div>
<div class="line"><a name="l00630"></a><span class="lineno">  630</span>&#160;  <span class="keywordtype">void</span></div>
<div class="line"><a name="l00631"></a><span class="lineno">  631</span>&#160;  <a class="code" href="classmets_1_1swap__neighborhood.html">mets::swap_neighborhood</a>&lt;random_generator</div>
<div class="line"><a name="l00632"></a><span class="lineno">  632</span>&#160;              &gt;::randomize_move(<a class="code" href="classmets_1_1swap__elements.html">swap_elements</a>&amp; m, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> size)</div>
<div class="line"><a name="l00633"></a><span class="lineno">  633</span>&#160;  {</div>
<div class="line"><a name="l00634"></a><span class="lineno">  634</span>&#160;    <span class="keywordtype">int</span> p1 = int_range(rng, size);</div>
<div class="line"><a name="l00635"></a><span class="lineno">  635</span>&#160;    <span class="keywordtype">int</span> p2 = int_range(rng, size);</div>
<div class="line"><a name="l00636"></a><span class="lineno">  636</span>&#160;    <span class="keywordflow">while</span>(p1 == p2) </div>
<div class="line"><a name="l00637"></a><span class="lineno">  637</span>&#160;      p2 = int_range(rng, size);</div>
<div class="line"><a name="l00638"></a><span class="lineno">  638</span>&#160;    <span class="comment">// we are friend, so we know how to handle the nuts&amp;bolts of</span></div>
<div class="line"><a name="l00639"></a><span class="lineno">  639</span>&#160;    <span class="comment">// swap_elements</span></div>
<div class="line"><a name="l00640"></a><span class="lineno">  640</span>&#160;    m.<a class="code" href="classmets_1_1swap__elements.html#ad0b091837bf8081d2288a354b1cdb88e">p1</a> = std::min(p1,p2); </div>
<div class="line"><a name="l00641"></a><span class="lineno">  641</span>&#160;    m.<a class="code" href="classmets_1_1swap__elements.html#af363135d28b4924d8b5efc48d7d2cffc">p2</a> = std::max(p1,p2); </div>
<div class="line"><a name="l00642"></a><span class="lineno">  642</span>&#160;  }</div>
<div class="line"><a name="l00643"></a><span class="lineno">  643</span>&#160; </div>
<div class="line"><a name="l00645"></a><span class="lineno"><a class="line" href="classmets_1_1swap__full__neighborhood.html">  645</a></span>&#160;  <span class="keyword">class </span><a class="code" href="classmets_1_1swap__full__neighborhood.html">swap_full_neighborhood</a> : <span class="keyword">public</span> <a class="code" href="classmets_1_1move__manager.html">mets::move_manager</a></div>
<div class="line"><a name="l00646"></a><span class="lineno">  646</span>&#160;  {</div>
<div class="line"><a name="l00647"></a><span class="lineno">  647</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00653"></a><span class="lineno"><a class="line" href="classmets_1_1swap__full__neighborhood.html#ab114139d615f8fa00fe092103eae0c1f">  653</a></span>&#160;    <a class="code" href="classmets_1_1swap__full__neighborhood.html#ab114139d615f8fa00fe092103eae0c1f">swap_full_neighborhood</a>(<span class="keywordtype">int</span> <a class="code" href="classmets_1_1move__manager.html#a07f46fd5f66246612d7595e78329f6d2">size</a>) : <a class="code" href="classmets_1_1move__manager.html">move_manager</a>()</div>
<div class="line"><a name="l00654"></a><span class="lineno">  654</span>&#160;    {</div>
<div class="line"><a name="l00655"></a><span class="lineno">  655</span>&#160;      <span class="keywordflow">for</span>(<span class="keywordtype">int</span> ii(0); ii!=<a class="code" href="classmets_1_1move__manager.html#a07f46fd5f66246612d7595e78329f6d2">size</a>-1; ++ii)</div>
<div class="line"><a name="l00656"></a><span class="lineno">  656</span>&#160;    <span class="keywordflow">for</span>(<span class="keywordtype">int</span> jj(ii+1); jj!=<a class="code" href="classmets_1_1move__manager.html#a07f46fd5f66246612d7595e78329f6d2">size</a>; ++jj)</div>
<div class="line"><a name="l00657"></a><span class="lineno">  657</span>&#160;      <a class="code" href="classmets_1_1move__manager.html#a764ca3061b1f019b5508fc03323fd501">moves_m</a>.push_back(<span class="keyword">new</span> <a class="code" href="classmets_1_1swap__elements.html">swap_elements</a>(ii,jj));</div>
<div class="line"><a name="l00658"></a><span class="lineno">  658</span>&#160;    } </div>
<div class="line"><a name="l00659"></a><span class="lineno">  659</span>&#160; </div>
<div class="line"><a name="l00661"></a><span class="lineno"><a class="line" href="classmets_1_1swap__full__neighborhood.html#a911f38a9ca80dab4bed155c5e463bc32">  661</a></span>&#160;    <a class="code" href="classmets_1_1swap__full__neighborhood.html#a911f38a9ca80dab4bed155c5e463bc32">~swap_full_neighborhood</a>() { </div>
<div class="line"><a name="l00662"></a><span class="lineno">  662</span>&#160;      <span class="keywordflow">for</span>(<a class="code" href="classmets_1_1move__manager.html#aeefc958bebc97fe6b61ce19c0ef37f1c">move_manager::iterator</a> it = <a class="code" href="classmets_1_1move__manager.html#a764ca3061b1f019b5508fc03323fd501">moves_m</a>.begin(); </div>
<div class="line"><a name="l00663"></a><span class="lineno">  663</span>&#160;      it != <a class="code" href="classmets_1_1move__manager.html#a764ca3061b1f019b5508fc03323fd501">moves_m</a>.end(); ++it)</div>
<div class="line"><a name="l00664"></a><span class="lineno">  664</span>&#160;    <span class="keyword">delete</span> *it;</div>
<div class="line"><a name="l00665"></a><span class="lineno">  665</span>&#160;    }</div>
<div class="line"><a name="l00666"></a><span class="lineno">  666</span>&#160;    </div>
<div class="line"><a name="l00668"></a><span class="lineno"><a class="line" href="classmets_1_1swap__full__neighborhood.html#a63ab451a42dc73a94e9081396afddd8e">  668</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classmets_1_1swap__full__neighborhood.html#a63ab451a42dc73a94e9081396afddd8e">refresh</a>(<a class="code" href="classmets_1_1feasible__solution.html">mets::feasible_solution</a>&amp; <span class="comment">/*s*/</span>) { }</div>
<div class="line"><a name="l00669"></a><span class="lineno">  669</span>&#160;    </div>
<div class="line"><a name="l00670"></a><span class="lineno">  670</span>&#160;  };</div>
<div class="line"><a name="l00671"></a><span class="lineno">  671</span>&#160; </div>
<div class="line"><a name="l00672"></a><span class="lineno">  672</span>&#160; </div>
<div class="line"><a name="l00674"></a><span class="lineno"><a class="line" href="classmets_1_1invert__full__neighborhood.html">  674</a></span>&#160;  <span class="keyword">class </span><a class="code" href="classmets_1_1invert__full__neighborhood.html">invert_full_neighborhood</a> : <span class="keyword">public</span> <a class="code" href="classmets_1_1move__manager.html">mets::move_manager</a></div>
<div class="line"><a name="l00675"></a><span class="lineno">  675</span>&#160;  {</div>
<div class="line"><a name="l00676"></a><span class="lineno">  676</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00677"></a><span class="lineno">  677</span>&#160;    <a class="code" href="classmets_1_1invert__full__neighborhood.html">invert_full_neighborhood</a>(<span class="keywordtype">int</span> <a class="code" href="classmets_1_1move__manager.html#a07f46fd5f66246612d7595e78329f6d2">size</a>) : <a class="code" href="classmets_1_1move__manager.html#a546406d667dc0d50b5e96ba9f26df457">move_manager</a>()</div>
<div class="line"><a name="l00678"></a><span class="lineno">  678</span>&#160;    {</div>
<div class="line"><a name="l00679"></a><span class="lineno">  679</span>&#160;      <span class="keywordflow">for</span>(<span class="keywordtype">int</span> ii(0); ii!=<a class="code" href="classmets_1_1move__manager.html#a07f46fd5f66246612d7595e78329f6d2">size</a>; ++ii)</div>
<div class="line"><a name="l00680"></a><span class="lineno">  680</span>&#160;    <span class="keywordflow">for</span>(<span class="keywordtype">int</span> jj(0); jj!=<a class="code" href="classmets_1_1move__manager.html#a07f46fd5f66246612d7595e78329f6d2">size</a>; ++jj)</div>
<div class="line"><a name="l00681"></a><span class="lineno">  681</span>&#160;      <span class="keywordflow">if</span>(ii != jj)</div>
<div class="line"><a name="l00682"></a><span class="lineno">  682</span>&#160;        <a class="code" href="classmets_1_1move__manager.html#a764ca3061b1f019b5508fc03323fd501">moves_m</a>.push_back(<span class="keyword">new</span> <a class="code" href="classmets_1_1invert__subsequence.html">invert_subsequence</a>(ii,jj));</div>
<div class="line"><a name="l00683"></a><span class="lineno">  683</span>&#160;    } </div>
<div class="line"><a name="l00684"></a><span class="lineno">  684</span>&#160; </div>
<div class="line"><a name="l00686"></a><span class="lineno"><a class="line" href="classmets_1_1invert__full__neighborhood.html#a822489092d1704f415bb71b1c5dc9e20">  686</a></span>&#160;    <a class="code" href="classmets_1_1invert__full__neighborhood.html#a822489092d1704f415bb71b1c5dc9e20">~invert_full_neighborhood</a>() { </div>
<div class="line"><a name="l00687"></a><span class="lineno">  687</span>&#160;      <span class="keywordflow">for</span>(std::deque&lt;move*&gt;::iterator it = <a class="code" href="classmets_1_1move__manager.html#a764ca3061b1f019b5508fc03323fd501">moves_m</a>.begin(); </div>
<div class="line"><a name="l00688"></a><span class="lineno">  688</span>&#160;      it != <a class="code" href="classmets_1_1move__manager.html#a764ca3061b1f019b5508fc03323fd501">moves_m</a>.end(); ++it)</div>
<div class="line"><a name="l00689"></a><span class="lineno">  689</span>&#160;    <span class="keyword">delete</span> *it;</div>
<div class="line"><a name="l00690"></a><span class="lineno">  690</span>&#160;    }</div>
<div class="line"><a name="l00691"></a><span class="lineno">  691</span>&#160; </div>
<div class="line"><a name="l00693"></a><span class="lineno">  693</span>&#160;    <span class="keywordtype">void</span> </div>
<div class="line"><a name="l00694"></a><span class="lineno"><a class="line" href="classmets_1_1invert__full__neighborhood.html#a8f293bde1f74daae7ce62fb31c9c0811">  694</a></span>&#160;    <a class="code" href="classmets_1_1invert__full__neighborhood.html#a8f293bde1f74daae7ce62fb31c9c0811">refresh</a>(<a class="code" href="classmets_1_1feasible__solution.html">mets::feasible_solution</a>&amp; <span class="comment">/*s*/</span>)</div>
<div class="line"><a name="l00695"></a><span class="lineno">  695</span>&#160;    { }</div>
<div class="line"><a name="l00696"></a><span class="lineno">  696</span>&#160; </div>
<div class="line"><a name="l00697"></a><span class="lineno">  697</span>&#160;  };</div>
<div class="line"><a name="l00698"></a><span class="lineno">  698</span>&#160; </div>
<div class="line"><a name="l00700"></a><span class="lineno">  700</span>&#160; </div>
<div class="line"><a name="l00702"></a><span class="lineno"><a class="line" href="classmets_1_1mana__move__hash.html">  702</a></span>&#160;  <span class="keyword">class </span><a class="code" href="classmets_1_1mana__move__hash.html">mana_move_hash</a> </div>
<div class="line"><a name="l00703"></a><span class="lineno">  703</span>&#160;  {</div>
<div class="line"><a name="l00704"></a><span class="lineno">  704</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00705"></a><span class="lineno">  705</span>&#160;    <span class="keywordtype">size_t</span> operator()(<a class="code" href="classmets_1_1mana__move.html">mana_move</a> <span class="keyword">const</span>* mov)<span class="keyword"> const </span></div>
<div class="line"><a name="l00706"></a><span class="lineno">  706</span>&#160;<span class="keyword">    </span>{<span class="keywordflow">return</span> mov-&gt;hash();}</div>
<div class="line"><a name="l00707"></a><span class="lineno">  707</span>&#160;  };</div>
<div class="line"><a name="l00708"></a><span class="lineno">  708</span>&#160;  </div>
<div class="line"><a name="l00710"></a><span class="lineno">  710</span>&#160;  <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Tp&gt;</div>
<div class="line"><a name="l00711"></a><span class="lineno"><a class="line" href="structmets_1_1dereferenced__equal__to.html">  711</a></span>&#160;  <span class="keyword">struct </span><a class="code" href="structmets_1_1dereferenced__equal__to.html">dereferenced_equal_to</a> </div>
<div class="line"><a name="l00712"></a><span class="lineno">  712</span>&#160;  {</div>
<div class="line"><a name="l00713"></a><span class="lineno">  713</span>&#160;    <span class="keywordtype">bool</span> operator()(<span class="keyword">const</span> Tp l, </div>
<div class="line"><a name="l00714"></a><span class="lineno">  714</span>&#160;            <span class="keyword">const</span> Tp r)<span class="keyword"> const </span></div>
<div class="line"><a name="l00715"></a><span class="lineno">  715</span>&#160;<span class="keyword">    </span>{ <span class="keywordflow">return</span> l-&gt;operator==(*r); }</div>
<div class="line"><a name="l00716"></a><span class="lineno">  716</span>&#160;  };</div>
<div class="line"><a name="l00717"></a><span class="lineno">  717</span>&#160; </div>
<div class="line"><a name="l00718"></a><span class="lineno">  718</span>&#160;}</div>
<div class="line"><a name="l00719"></a><span class="lineno">  719</span>&#160; </div>
<div class="line"><a name="l00720"></a><span class="lineno">  720</span>&#160;<span class="comment">//________________________________________________________________________</span></div>
<div class="line"><a name="l00721"></a><span class="lineno">  721</span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span></div>
<div class="line"><a name="l00722"></a><span class="lineno"><a class="line" href="classmets_1_1permutation__problem.html#afb6ec1359a68d87ff2a3f1648c684b8a">  722</a></span>&#160;<a class="code" href="classmets_1_1permutation__problem.html#afb6ec1359a68d87ff2a3f1648c684b8a">mets::permutation_problem::copy_from</a>(<span class="keyword">const</span> <a class="code" href="classmets_1_1copyable.html">mets::copyable</a>&amp; other)</div>
<div class="line"><a name="l00723"></a><span class="lineno">  723</span>&#160;{</div>
<div class="line"><a name="l00724"></a><span class="lineno">  724</span>&#160;  <span class="keyword">const</span> <a class="code" href="classmets_1_1permutation__problem.html">mets::permutation_problem</a>&amp; o = </div>
<div class="line"><a name="l00725"></a><span class="lineno">  725</span>&#160;    <span class="keyword">dynamic_cast&lt;</span><span class="keyword">const </span><a class="code" href="classmets_1_1permutation__problem.html">mets::permutation_problem</a>&amp;<span class="keyword">&gt;</span>(other);</div>
<div class="line"><a name="l00726"></a><span class="lineno">  726</span>&#160;  pi_m = o.pi_m;</div>
<div class="line"><a name="l00727"></a><span class="lineno">  727</span>&#160;  cost_m = o.cost_m;</div>
<div class="line"><a name="l00728"></a><span class="lineno">  728</span>&#160;}</div>
<div class="line"><a name="l00729"></a><span class="lineno">  729</span>&#160; </div>
<div class="line"><a name="l00730"></a><span class="lineno">  730</span>&#160;<span class="comment">//________________________________________________________________________</span></div>
<div class="line"><a name="l00731"></a><span class="lineno">  731</span>&#160;<span class="keyword">inline</span> <span class="keywordtype">bool</span></div>
<div class="line"><a name="l00732"></a><span class="lineno"><a class="line" href="classmets_1_1swap__elements.html#ae6262642f3c5802d86fc2b4dc5d2ad6b">  732</a></span>&#160;<a class="code" href="classmets_1_1swap__elements.html#ae6262642f3c5802d86fc2b4dc5d2ad6b">mets::swap_elements::operator==</a>(<span class="keyword">const</span> <a class="code" href="classmets_1_1mana__move.html">mets::mana_move</a>&amp; o)<span class="keyword"> const</span></div>
<div class="line"><a name="l00733"></a><span class="lineno">  733</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00734"></a><span class="lineno">  734</span>&#160;  <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l00735"></a><span class="lineno">  735</span>&#160;    <span class="keyword">const</span> <a class="code" href="classmets_1_1swap__elements.html">mets::swap_elements</a>&amp; other = </div>
<div class="line"><a name="l00736"></a><span class="lineno">  736</span>&#160;      <span class="keyword">dynamic_cast&lt;</span><span class="keyword">const </span><a class="code" href="classmets_1_1swap__elements.html">mets::swap_elements</a>&amp;<span class="keyword">&gt;</span>(o);</div>
<div class="line"><a name="l00737"></a><span class="lineno">  737</span>&#160;    <span class="keywordflow">return</span> (this-&gt;p1 == other.<a class="code" href="classmets_1_1swap__elements.html#ad0b091837bf8081d2288a354b1cdb88e">p1</a> &amp;&amp; this-&gt;p2 == other.<a class="code" href="classmets_1_1swap__elements.html#af363135d28b4924d8b5efc48d7d2cffc">p2</a>);</div>
<div class="line"><a name="l00738"></a><span class="lineno">  738</span>&#160;  } <span class="keywordflow">catch</span> (std::bad_cast&amp; e) {</div>
<div class="line"><a name="l00739"></a><span class="lineno">  739</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00740"></a><span class="lineno">  740</span>&#160;  }</div>
<div class="line"><a name="l00741"></a><span class="lineno">  741</span>&#160;}</div>
<div class="line"><a name="l00742"></a><span class="lineno">  742</span>&#160; </div>
<div class="line"><a name="l00743"></a><span class="lineno">  743</span>&#160;<span class="comment">//________________________________________________________________________</span></div>
<div class="line"><a name="l00744"></a><span class="lineno">  744</span>&#160; </div>
<div class="line"><a name="l00745"></a><span class="lineno">  745</span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span></div>
<div class="line"><a name="l00746"></a><span class="lineno"><a class="line" href="classmets_1_1invert__subsequence.html#ade3c72591bca9042b637fe99c51bc97b">  746</a></span>&#160;<a class="code" href="classmets_1_1invert__subsequence.html#ade3c72591bca9042b637fe99c51bc97b">mets::invert_subsequence::apply</a>(<a class="code" href="classmets_1_1feasible__solution.html">mets::feasible_solution</a>&amp; s)<span class="keyword"> const</span></div>
<div class="line"><a name="l00747"></a><span class="lineno">  747</span>&#160;<span class="keyword"></span>{ </div>
<div class="line"><a name="l00748"></a><span class="lineno">  748</span>&#160;  <a class="code" href="classmets_1_1permutation__problem.html">mets::permutation_problem</a>&amp; sol = </div>
<div class="line"><a name="l00749"></a><span class="lineno">  749</span>&#160;    <span class="keyword">static_cast&lt;</span><a class="code" href="classmets_1_1permutation__problem.html">mets::permutation_problem</a>&amp;<span class="keyword">&gt;</span>(s);</div>
<div class="line"><a name="l00750"></a><span class="lineno">  750</span>&#160;  <span class="keywordtype">int</span> size = <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(sol.<a class="code" href="classmets_1_1permutation__problem.html#aa89b4d4809ec78d687d0537d833adc27">size</a>());</div>
<div class="line"><a name="l00751"></a><span class="lineno">  751</span>&#160;  <span class="keywordtype">int</span> top = p1 &lt; p2 ? (p2-p1+1) : (size+p2-p1+1);</div>
<div class="line"><a name="l00752"></a><span class="lineno">  752</span>&#160;  <span class="keywordflow">for</span>(<span class="keywordtype">int</span> ii(0); ii!=top/2; ++ii)</div>
<div class="line"><a name="l00753"></a><span class="lineno">  753</span>&#160;    {</div>
<div class="line"><a name="l00754"></a><span class="lineno">  754</span>&#160;      <span class="keywordtype">int</span> from = (p1+ii)%size;</div>
<div class="line"><a name="l00755"></a><span class="lineno">  755</span>&#160;      <span class="keywordtype">int</span> to = (size+p2-ii)%size;</div>
<div class="line"><a name="l00756"></a><span class="lineno">  756</span>&#160;      assert(from &gt;= 0 &amp;&amp; from &lt; size);</div>
<div class="line"><a name="l00757"></a><span class="lineno">  757</span>&#160;      assert(to &gt;= 0 &amp;&amp; to &lt; size);</div>
<div class="line"><a name="l00758"></a><span class="lineno">  758</span>&#160;      sol.<a class="code" href="classmets_1_1permutation__problem.html#a04b74de5cecfec914c53d5ff07129f3b">apply_swap</a>(from, to); </div>
<div class="line"><a name="l00759"></a><span class="lineno">  759</span>&#160;    }</div>
<div class="line"><a name="l00760"></a><span class="lineno">  760</span>&#160;}</div>
<div class="line"><a name="l00761"></a><span class="lineno">  761</span>&#160; </div>
<div class="line"><a name="l00762"></a><span class="lineno">  762</span>&#160;<span class="keyword">inline</span> mets::gol_type</div>
<div class="line"><a name="l00763"></a><span class="lineno"><a class="line" href="classmets_1_1invert__subsequence.html#ad64ffab62633cc4b43903eb3bfe5e328">  763</a></span>&#160;<a class="code" href="classmets_1_1invert__subsequence.html#ad64ffab62633cc4b43903eb3bfe5e328">mets::invert_subsequence::evaluate</a>(<span class="keyword">const</span> <a class="code" href="classmets_1_1feasible__solution.html">mets::feasible_solution</a>&amp; s)<span class="keyword"> const</span></div>
<div class="line"><a name="l00764"></a><span class="lineno">  764</span>&#160;<span class="keyword"></span>{ </div>
<div class="line"><a name="l00765"></a><span class="lineno">  765</span>&#160;  <span class="keyword">const</span> <a class="code" href="classmets_1_1permutation__problem.html">mets::permutation_problem</a>&amp; sol = </div>
<div class="line"><a name="l00766"></a><span class="lineno">  766</span>&#160;    <span class="keyword">static_cast&lt;</span><span class="keyword">const </span><a class="code" href="classmets_1_1permutation__problem.html">mets::permutation_problem</a>&amp;<span class="keyword">&gt;</span>(s);</div>
<div class="line"><a name="l00767"></a><span class="lineno">  767</span>&#160;  <span class="keywordtype">int</span> size = <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(sol.<a class="code" href="classmets_1_1permutation__problem.html#aa89b4d4809ec78d687d0537d833adc27">size</a>());</div>
<div class="line"><a name="l00768"></a><span class="lineno">  768</span>&#160;  <span class="keywordtype">int</span> top = p1 &lt; p2 ? (p2-p1+1) : (size+p2-p1+1);</div>
<div class="line"><a name="l00769"></a><span class="lineno">  769</span>&#160;  mets::gol_type eval = 0.0;</div>
<div class="line"><a name="l00770"></a><span class="lineno">  770</span>&#160;  <span class="keywordflow">for</span>(<span class="keywordtype">int</span> ii(0); ii!=top/2; ++ii)</div>
<div class="line"><a name="l00771"></a><span class="lineno">  771</span>&#160;    {</div>
<div class="line"><a name="l00772"></a><span class="lineno">  772</span>&#160;      <span class="keywordtype">int</span> from = (p1+ii)%size;</div>
<div class="line"><a name="l00773"></a><span class="lineno">  773</span>&#160;      <span class="keywordtype">int</span> to = (size+p2-ii)%size;</div>
<div class="line"><a name="l00774"></a><span class="lineno">  774</span>&#160;      assert(from &gt;= 0 &amp;&amp; from &lt; size);</div>
<div class="line"><a name="l00775"></a><span class="lineno">  775</span>&#160;      assert(to &gt;= 0 &amp;&amp; to &lt; size);</div>
<div class="line"><a name="l00776"></a><span class="lineno">  776</span>&#160;      eval += sol.<a class="code" href="classmets_1_1permutation__problem.html#a223eaad235680e4d4f3008ac7eeaeb82">evaluate_swap</a>(from, to); </div>
<div class="line"><a name="l00777"></a><span class="lineno">  777</span>&#160;    }</div>
<div class="line"><a name="l00778"></a><span class="lineno">  778</span>&#160;  <span class="keywordflow">return</span> eval;</div>
<div class="line"><a name="l00779"></a><span class="lineno">  779</span>&#160;}</div>
<div class="line"><a name="l00780"></a><span class="lineno">  780</span>&#160; </div>
<div class="line"><a name="l00781"></a><span class="lineno">  781</span>&#160;<span class="keyword">inline</span> <span class="keywordtype">bool</span></div>
<div class="line"><a name="l00782"></a><span class="lineno"><a class="line" href="classmets_1_1invert__subsequence.html#a75cbeca37763195489db7c26a7045305">  782</a></span>&#160;<a class="code" href="classmets_1_1invert__subsequence.html#a75cbeca37763195489db7c26a7045305">mets::invert_subsequence::operator==</a>(<span class="keyword">const</span> <a class="code" href="classmets_1_1mana__move.html">mets::mana_move</a>&amp; o)<span class="keyword"> const</span></div>
<div class="line"><a name="l00783"></a><span class="lineno">  783</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00784"></a><span class="lineno">  784</span>&#160;  <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l00785"></a><span class="lineno">  785</span>&#160;    <span class="keyword">const</span> <a class="code" href="classmets_1_1invert__subsequence.html">mets::invert_subsequence</a>&amp; other = </div>
<div class="line"><a name="l00786"></a><span class="lineno">  786</span>&#160;      <span class="keyword">dynamic_cast&lt;</span><span class="keyword">const </span><a class="code" href="classmets_1_1invert__subsequence.html">mets::invert_subsequence</a>&amp;<span class="keyword">&gt;</span>(o);</div>
<div class="line"><a name="l00787"></a><span class="lineno">  787</span>&#160;    <span class="keywordflow">return</span> (this-&gt;p1 == other.<a class="code" href="classmets_1_1invert__subsequence.html#a7e032c3a48524ea28fca3cad2f09dd86">p1</a> &amp;&amp; this-&gt;p2 == other.<a class="code" href="classmets_1_1invert__subsequence.html#ae971fa9cdc048e5bd34bd939e2f82de5">p2</a>);</div>
<div class="line"><a name="l00788"></a><span class="lineno">  788</span>&#160;  } <span class="keywordflow">catch</span> (std::bad_cast&amp; e) {</div>
<div class="line"><a name="l00789"></a><span class="lineno">  789</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00790"></a><span class="lineno">  790</span>&#160;  }</div>
<div class="line"><a name="l00791"></a><span class="lineno">  791</span>&#160;}</div>
<div class="line"><a name="l00792"></a><span class="lineno">  792</span>&#160; </div>
<div class="line"><a name="l00793"></a><span class="lineno">  793</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassmets_1_1clonable_html"><div class="ttname"><a href="classmets_1_1clonable.html">mets::clonable</a></div><div class="ttdoc">An interface for prototype objects.</div><div class="ttdef"><b>Definition:</b> model.hh:79</div></div>
<div class="ttc" id="aclassmets_1_1copyable_html"><div class="ttname"><a href="classmets_1_1copyable.html">mets::copyable</a></div><div class="ttdoc">An interface for copyable objects.</div><div class="ttdef"><b>Definition:</b> model.hh:97</div></div>
<div class="ttc" id="aclassmets_1_1evaluable__solution_html"><div class="ttname"><a href="classmets_1_1evaluable__solution.html">mets::evaluable_solution</a></div><div class="ttdoc">A copyable and evaluable solution implementation,</div><div class="ttdef"><b>Definition:</b> model.hh:157</div></div>
<div class="ttc" id="aclassmets_1_1evaluable__solution_html_a9ef212cb6a07b57bf34d0af60deb6fad"><div class="ttname"><a href="classmets_1_1evaluable__solution.html#a9ef212cb6a07b57bf34d0af60deb6fad">mets::evaluable_solution::cost_function</a></div><div class="ttdeci">virtual gol_type cost_function() const =0</div><div class="ttdoc">Cost function to be minimized.</div></div>
<div class="ttc" id="aclassmets_1_1feasible__solution_html"><div class="ttname"><a href="classmets_1_1feasible__solution.html">mets::feasible_solution</a></div><div class="ttdoc">interface of a feasible solution space to be searched with tabu search.</div><div class="ttdef"><b>Definition:</b> model.hh:135</div></div>
<div class="ttc" id="aclassmets_1_1feasible__solution_html_ab15b3260d5e1eec2a79e103347ca788f"><div class="ttname"><a href="classmets_1_1feasible__solution.html#ab15b3260d5e1eec2a79e103347ca788f">mets::feasible_solution::~feasible_solution</a></div><div class="ttdeci">virtual ~feasible_solution()</div><div class="ttdoc">Virtual dtor.</div><div class="ttdef"><b>Definition:</b> model.hh:139</div></div>
<div class="ttc" id="aclassmets_1_1hashable_html"><div class="ttname"><a href="classmets_1_1hashable.html">mets::hashable</a></div><div class="ttdoc">An interface for hashable objects.</div><div class="ttdef"><b>Definition:</b> model.hh:88</div></div>
<div class="ttc" id="aclassmets_1_1invert__full__neighborhood_html"><div class="ttname"><a href="classmets_1_1invert__full__neighborhood.html">mets::invert_full_neighborhood</a></div><div class="ttdoc">Generates a the full subsequence inversion neighborhood.</div><div class="ttdef"><b>Definition:</b> model.hh:675</div></div>
<div class="ttc" id="aclassmets_1_1invert__full__neighborhood_html_a822489092d1704f415bb71b1c5dc9e20"><div class="ttname"><a href="classmets_1_1invert__full__neighborhood.html#a822489092d1704f415bb71b1c5dc9e20">mets::invert_full_neighborhood::~invert_full_neighborhood</a></div><div class="ttdeci">~invert_full_neighborhood()</div><div class="ttdoc">Dtor.</div><div class="ttdef"><b>Definition:</b> model.hh:686</div></div>
<div class="ttc" id="aclassmets_1_1invert__full__neighborhood_html_a8f293bde1f74daae7ce62fb31c9c0811"><div class="ttname"><a href="classmets_1_1invert__full__neighborhood.html#a8f293bde1f74daae7ce62fb31c9c0811">mets::invert_full_neighborhood::refresh</a></div><div class="ttdeci">void refresh(mets::feasible_solution &amp;)</div><div class="ttdoc">This is a static neighborhood</div><div class="ttdef"><b>Definition:</b> model.hh:694</div></div>
<div class="ttc" id="aclassmets_1_1invert__subsequence_html"><div class="ttname"><a href="classmets_1_1invert__subsequence.html">mets::invert_subsequence</a></div><div class="ttdoc">A mets::mana_move that swaps a subsequence of elements in a mets::permutation_problem.</div><div class="ttdef"><b>Definition:</b> model.hh:442</div></div>
<div class="ttc" id="aclassmets_1_1invert__subsequence_html_a1e4a701e9c5aa341079f88b7df86c560"><div class="ttname"><a href="classmets_1_1invert__subsequence.html#a1e4a701e9c5aa341079f88b7df86c560">mets::invert_subsequence::invert_subsequence</a></div><div class="ttdeci">invert_subsequence(int from, int to)</div><div class="ttdoc">A move that swaps from and to.</div><div class="ttdef"><b>Definition:</b> model.hh:446</div></div>
<div class="ttc" id="aclassmets_1_1invert__subsequence_html_a75cbeca37763195489db7c26a7045305"><div class="ttname"><a href="classmets_1_1invert__subsequence.html#a75cbeca37763195489db7c26a7045305">mets::invert_subsequence::operator==</a></div><div class="ttdeci">bool operator==(const mets::mana_move &amp;o) const</div><div class="ttdoc">Comparison operator used to tell if this move is equal to a move in the tabu list.</div><div class="ttdef"><b>Definition:</b> model.hh:782</div></div>
<div class="ttc" id="aclassmets_1_1invert__subsequence_html_a7e032c3a48524ea28fca3cad2f09dd86"><div class="ttname"><a href="classmets_1_1invert__subsequence.html#a7e032c3a48524ea28fca3cad2f09dd86">mets::invert_subsequence::p1</a></div><div class="ttdeci">int p1</div><div class="ttdoc">the first element to swap</div><div class="ttdef"><b>Definition:</b> model.hh:477</div></div>
<div class="ttc" id="aclassmets_1_1invert__subsequence_html_ad64ffab62633cc4b43903eb3bfe5e328"><div class="ttname"><a href="classmets_1_1invert__subsequence.html#ad64ffab62633cc4b43903eb3bfe5e328">mets::invert_subsequence::evaluate</a></div><div class="ttdeci">gol_type evaluate(const mets::feasible_solution &amp;s) const</div><div class="ttdoc">Virtual method that applies the move on a point</div><div class="ttdef"><b>Definition:</b> model.hh:763</div></div>
<div class="ttc" id="aclassmets_1_1invert__subsequence_html_ade3c72591bca9042b637fe99c51bc97b"><div class="ttname"><a href="classmets_1_1invert__subsequence.html#ade3c72591bca9042b637fe99c51bc97b">mets::invert_subsequence::apply</a></div><div class="ttdeci">void apply(mets::feasible_solution &amp;s) const</div><div class="ttdoc">Virtual method that applies the move on a point</div><div class="ttdef"><b>Definition:</b> model.hh:746</div></div>
<div class="ttc" id="aclassmets_1_1invert__subsequence_html_ae971fa9cdc048e5bd34bd939e2f82de5"><div class="ttname"><a href="classmets_1_1invert__subsequence.html#ae971fa9cdc048e5bd34bd939e2f82de5">mets::invert_subsequence::p2</a></div><div class="ttdeci">int p2</div><div class="ttdoc">the second element to swap</div><div class="ttdef"><b>Definition:</b> model.hh:478</div></div>
<div class="ttc" id="aclassmets_1_1invert__subsequence_html_af5cc9c3af4ce11eab78cadffe4f81df1"><div class="ttname"><a href="classmets_1_1invert__subsequence.html#af5cc9c3af4ce11eab78cadffe4f81df1">mets::invert_subsequence::hash</a></div><div class="ttdeci">size_t hash() const</div><div class="ttdoc">An hash function used by the tabu list (the hash value is used to insert the move in an hash set).</div><div class="ttdef"><b>Definition:</b> model.hh:465</div></div>
<div class="ttc" id="aclassmets_1_1mana__move__hash_html"><div class="ttname"><a href="classmets_1_1mana__move__hash.html">mets::mana_move_hash</a></div><div class="ttdoc">Functor class to allow hash_set of moves (used by tabu list)</div><div class="ttdef"><b>Definition:</b> model.hh:703</div></div>
<div class="ttc" id="aclassmets_1_1mana__move_html"><div class="ttname"><a href="classmets_1_1mana__move.html">mets::mana_move</a></div><div class="ttdoc">A Mana Move is a move that can be automatically made tabu by the mets::simple_tabu_list.</div><div class="ttdef"><b>Definition:</b> model.hh:355</div></div>
<div class="ttc" id="aclassmets_1_1mana__move_html_a0faf5590c15ae4ed13470033fb7ed000"><div class="ttname"><a href="classmets_1_1mana__move.html#a0faf5590c15ae4ed13470033fb7ed000">mets::mana_move::opposite_of</a></div><div class="ttdeci">virtual mana_move * opposite_of() const</div><div class="ttdoc">Create and return a new move that is the reverse of this one</div><div class="ttdef"><b>Definition:</b> model.hh:367</div></div>
<div class="ttc" id="aclassmets_1_1mana__move_html_a7ff17d8c4ffa899dc3ba7279e7e829c0"><div class="ttname"><a href="classmets_1_1mana__move.html#a7ff17d8c4ffa899dc3ba7279e7e829c0">mets::mana_move::operator==</a></div><div class="ttdeci">virtual bool operator==(const mana_move &amp;other) const =0</div><div class="ttdoc">Tell if this move equals another w.r.t. the tabu list management (for mets::simple_tabu_list)</div></div>
<div class="ttc" id="aclassmets_1_1move__manager_html"><div class="ttname"><a href="classmets_1_1move__manager.html">mets::move_manager</a></div><div class="ttdoc">A neighborhood generator.</div><div class="ttdef"><b>Definition:</b> model.hh:508</div></div>
<div class="ttc" id="aclassmets_1_1move__manager_html_a07f46fd5f66246612d7595e78329f6d2"><div class="ttname"><a href="classmets_1_1move__manager.html#a07f46fd5f66246612d7595e78329f6d2">mets::move_manager::size</a></div><div class="ttdeci">size_type size() const</div><div class="ttdoc">Size of the neighborhood.</div><div class="ttdef"><b>Definition:</b> model.hh:539</div></div>
<div class="ttc" id="aclassmets_1_1move__manager_html_a1418389c4f7b900ab3ca9d211b6cf9b5"><div class="ttname"><a href="classmets_1_1move__manager.html#a1418389c4f7b900ab3ca9d211b6cf9b5">mets::move_manager::end</a></div><div class="ttdeci">iterator end()</div><div class="ttdoc">End iterator of available moves queue.</div><div class="ttdef"><b>Definition:</b> model.hh:535</div></div>
<div class="ttc" id="aclassmets_1_1move__manager_html_a27ab567f8a638f5d6db4b39c452c8b31"><div class="ttname"><a href="classmets_1_1move__manager.html#a27ab567f8a638f5d6db4b39c452c8b31">mets::move_manager::begin</a></div><div class="ttdeci">iterator begin()</div><div class="ttdoc">Begin iterator of available moves queue.</div><div class="ttdef"><b>Definition:</b> model.hh:531</div></div>
<div class="ttc" id="aclassmets_1_1move__manager_html_a546406d667dc0d50b5e96ba9f26df457"><div class="ttname"><a href="classmets_1_1move__manager.html#a546406d667dc0d50b5e96ba9f26df457">mets::move_manager::move_manager</a></div><div class="ttdeci">move_manager()</div><div class="ttdoc">Initialize the move manager with an empty list of moves</div><div class="ttdef"><b>Definition:</b> model.hh:512</div></div>
<div class="ttc" id="aclassmets_1_1move__manager_html_a764ca3061b1f019b5508fc03323fd501"><div class="ttname"><a href="classmets_1_1move__manager.html#a764ca3061b1f019b5508fc03323fd501">mets::move_manager::moves_m</a></div><div class="ttdeci">std::deque&lt; move * &gt; moves_m</div><div class="ttdoc">The moves queue</div><div class="ttdef"><b>Definition:</b> model.hh:543</div></div>
<div class="ttc" id="aclassmets_1_1move__manager_html_a8043a2af47c32cd18d49549cc3075f26"><div class="ttname"><a href="classmets_1_1move__manager.html#a8043a2af47c32cd18d49549cc3075f26">mets::move_manager::~move_manager</a></div><div class="ttdeci">virtual ~move_manager()</div><div class="ttdoc">Virtual destructor</div><div class="ttdef"><b>Definition:</b> model.hh:517</div></div>
<div class="ttc" id="aclassmets_1_1move__manager_html_ab88fc9c9029575bf715a9d8563e77e62"><div class="ttname"><a href="classmets_1_1move__manager.html#ab88fc9c9029575bf715a9d8563e77e62">mets::move_manager::refresh</a></div><div class="ttdeci">virtual void refresh(mets::feasible_solution &amp;s)=0</div><div class="ttdoc">Selects a different set of moves at each iteration.</div></div>
<div class="ttc" id="aclassmets_1_1move__manager_html_aeefc958bebc97fe6b61ce19c0ef37f1c"><div class="ttname"><a href="classmets_1_1move__manager.html#aeefc958bebc97fe6b61ce19c0ef37f1c">mets::move_manager::iterator</a></div><div class="ttdeci">std::deque&lt; move * &gt;::iterator iterator</div><div class="ttdoc">Iterator type to iterate over moves of the neighborhood</div><div class="ttdef"><b>Definition:</b> model.hh:525</div></div>
<div class="ttc" id="aclassmets_1_1move__manager_html_afa4c4ed8f7f06f5b71d9bef68c11b36d"><div class="ttname"><a href="classmets_1_1move__manager.html#afa4c4ed8f7f06f5b71d9bef68c11b36d">mets::move_manager::size_type</a></div><div class="ttdeci">std::deque&lt; move * &gt;::size_type size_type</div><div class="ttdoc">Size type</div><div class="ttdef"><b>Definition:</b> model.hh:528</div></div>
<div class="ttc" id="aclassmets_1_1move_html"><div class="ttname"><a href="classmets_1_1move.html">mets::move</a></div><div class="ttdoc">Move to be operated on a feasible solution.</div><div class="ttdef"><b>Definition:</b> model.hh:310</div></div>
<div class="ttc" id="aclassmets_1_1move_html_a69c917e66e3f48d7df0136b6942a2476"><div class="ttname"><a href="classmets_1_1move.html#a69c917e66e3f48d7df0136b6942a2476">mets::move::evaluate</a></div><div class="ttdeci">virtual gol_type evaluate(const feasible_solution &amp;sol) const =0</div><div class="ttdoc">Evaluate the cost after the move.</div></div>
<div class="ttc" id="aclassmets_1_1move_html_ae80d24a084cd9a3841007f1e88c5ea12"><div class="ttname"><a href="classmets_1_1move.html#ae80d24a084cd9a3841007f1e88c5ea12">mets::move::apply</a></div><div class="ttdeci">virtual void apply(feasible_solution &amp;sol) const =0</div><div class="ttdoc">Operates this move on sol.</div></div>
<div class="ttc" id="aclassmets_1_1no__moves__error_html"><div class="ttname"><a href="classmets_1_1no__moves__error.html">mets::no_moves_error</a></div><div class="ttdoc">Exception risen when some algorithm has no more moves to make.</div><div class="ttdef"><b>Definition:</b> model.hh:51</div></div>
<div class="ttc" id="aclassmets_1_1permutation__problem_html"><div class="ttname"><a href="classmets_1_1permutation__problem.html">mets::permutation_problem</a></div><div class="ttdoc">An abstract permutation problem.</div><div class="ttdef"><b>Definition:</b> model.hh:183</div></div>
<div class="ttc" id="aclassmets_1_1permutation__problem_html_a04b74de5cecfec914c53d5ff07129f3b"><div class="ttname"><a href="classmets_1_1permutation__problem.html#a04b74de5cecfec914c53d5ff07129f3b">mets::permutation_problem::apply_swap</a></div><div class="ttdeci">void apply_swap(int i, int j)</div><div class="ttdoc">: Apply a swap and update the cost. Do not override unless you know what you are doing.</div><div class="ttdef"><b>Definition:</b> model.hh:242</div></div>
<div class="ttc" id="aclassmets_1_1permutation__problem_html_a223eaad235680e4d4f3008ac7eeaeb82"><div class="ttname"><a href="classmets_1_1permutation__problem.html#a223eaad235680e4d4f3008ac7eeaeb82">mets::permutation_problem::evaluate_swap</a></div><div class="ttdeci">virtual gol_type evaluate_swap(int i, int j) const =0</div><div class="ttdoc">: Evaluate a swap.</div></div>
<div class="ttc" id="aclassmets_1_1permutation__problem_html_a4dbc23d8f3e8e0fda5d085c75c87186c"><div class="ttname"><a href="classmets_1_1permutation__problem.html#a4dbc23d8f3e8e0fda5d085c75c87186c">mets::permutation_problem::update_cost</a></div><div class="ttdeci">void update_cost()</div><div class="ttdoc">Updates the cost with the one computed by the subclass. Do not override unless you know what you are ...</div><div class="ttdef"><b>Definition:</b> model.hh:236</div></div>
<div class="ttc" id="aclassmets_1_1permutation__problem_html_a5ae9de2f07e547f9140f8b77ea9fc5bf"><div class="ttname"><a href="classmets_1_1permutation__problem.html#a5ae9de2f07e547f9140f8b77ea9fc5bf">mets::permutation_problem::compute_cost</a></div><div class="ttdeci">virtual gol_type compute_cost() const =0</div><div class="ttdoc">: Compute cost of the whole solution.</div></div>
<div class="ttc" id="aclassmets_1_1permutation__problem_html_a8c23c755746873a10c81582bffb5d48b"><div class="ttname"><a href="classmets_1_1permutation__problem.html#a8c23c755746873a10c81582bffb5d48b">mets::permutation_problem::permutation_problem</a></div><div class="ttdeci">permutation_problem()</div><div class="ttdoc">Unimplemented.</div></div>
<div class="ttc" id="aclassmets_1_1permutation__problem_html_a8e8d83afe5be26c7000dafe31674efd5"><div class="ttname"><a href="classmets_1_1permutation__problem.html#a8e8d83afe5be26c7000dafe31674efd5">mets::permutation_problem::permutation_problem</a></div><div class="ttdeci">permutation_problem(int n)</div><div class="ttdoc">Inizialize pi_m = {0, 1, 2, ..., n-1}.</div><div class="ttdef"><b>Definition:</b> model.hh:190</div></div>
<div class="ttc" id="aclassmets_1_1permutation__problem_html_a99eb2edeb0132b1c92bd146bda766b30"><div class="ttname"><a href="classmets_1_1permutation__problem.html#a99eb2edeb0132b1c92bd146bda766b30">mets::permutation_problem::cost_function</a></div><div class="ttdeci">gol_type cost_function() const</div><div class="ttdoc">Returns the cost of the current solution. The default implementation provided returns the protected m...</div><div class="ttdef"><b>Definition:</b> model.hh:230</div></div>
<div class="ttc" id="aclassmets_1_1permutation__problem_html_aa89b4d4809ec78d687d0537d833adc27"><div class="ttname"><a href="classmets_1_1permutation__problem.html#aa89b4d4809ec78d687d0537d833adc27">mets::permutation_problem::size</a></div><div class="ttdeci">size_t size() const</div><div class="ttdoc">The size of the problem. Do not override unless you know what you are doing.</div><div class="ttdef"><b>Definition:</b> model.hh:223</div></div>
<div class="ttc" id="aclassmets_1_1permutation__problem_html_acb7ee40eabc97ada1f9d4d6cda486c66"><div class="ttname"><a href="classmets_1_1permutation__problem.html#acb7ee40eabc97ada1f9d4d6cda486c66">mets::permutation_problem::random_shuffle</a></div><div class="ttdeci">friend void random_shuffle(permutation_problem &amp;p, random_generator &amp;rng)</div><div class="ttdoc">Shuffle a permutation problem (generates a random starting point).</div><div class="ttdef"><b>Definition:</b> model.hh:258</div></div>
<div class="ttc" id="aclassmets_1_1permutation__problem_html_afb6ec1359a68d87ff2a3f1648c684b8a"><div class="ttname"><a href="classmets_1_1permutation__problem.html#afb6ec1359a68d87ff2a3f1648c684b8a">mets::permutation_problem::copy_from</a></div><div class="ttdeci">void copy_from(const copyable &amp;other)</div><div class="ttdoc">Copy from another permutation problem, if you introduce new member variables remember to override thi...</div><div class="ttdef"><b>Definition:</b> model.hh:722</div></div>
<div class="ttc" id="aclassmets_1_1printable_html"><div class="ttname"><a href="classmets_1_1printable.html">mets::printable</a></div><div class="ttdoc">An interface for printable objects.</div><div class="ttdef"><b>Definition:</b> model.hh:106</div></div>
<div class="ttc" id="aclassmets_1_1sequence_html"><div class="ttname"><a href="classmets_1_1sequence.html">mets::sequence</a></div><div class="ttdoc">A sequence function object useful as an STL generator.</div><div class="ttdef"><b>Definition:</b> model.hh:64</div></div>
<div class="ttc" id="aclassmets_1_1sequence_html_a14177f4a3aa54c1611747ab44356307a"><div class="ttname"><a href="classmets_1_1sequence.html#a14177f4a3aa54c1611747ab44356307a">mets::sequence::sequence</a></div><div class="ttdeci">sequence(int start=0)</div><div class="ttdoc">A sequence class starting at start.</div><div class="ttdef"><b>Definition:</b> model.hh:67</div></div>
<div class="ttc" id="aclassmets_1_1sequence_html_a8f6e2b7ee95d0c3295ac55e83c68d945"><div class="ttname"><a href="classmets_1_1sequence.html#a8f6e2b7ee95d0c3295ac55e83c68d945">mets::sequence::operator()</a></div><div class="ttdeci">int operator()()</div><div class="ttdoc">Subscript operator. Each call increments the value of the sequence.</div><div class="ttdef"><b>Definition:</b> model.hh:72</div></div>
<div class="ttc" id="aclassmets_1_1swap__elements_html"><div class="ttname"><a href="classmets_1_1swap__elements.html">mets::swap_elements</a></div><div class="ttdoc">A mets::mana_move that swaps two elements in a mets::permutation_problem.</div><div class="ttdef"><b>Definition:</b> model.hh:387</div></div>
<div class="ttc" id="aclassmets_1_1swap__elements_html_a0f4f4e09d0bbd6f282eb433844ecc5a0"><div class="ttname"><a href="classmets_1_1swap__elements.html#a0f4f4e09d0bbd6f282eb433844ecc5a0">mets::swap_elements::change</a></div><div class="ttdeci">void change(int from, int to)</div><div class="ttdoc">Modify this swap move.</div><div class="ttdef"><b>Definition:</b> model.hh:425</div></div>
<div class="ttc" id="aclassmets_1_1swap__elements_html_a2dc625e7f5b1557c118f79e7ac521485"><div class="ttname"><a href="classmets_1_1swap__elements.html#a2dc625e7f5b1557c118f79e7ac521485">mets::swap_elements::apply</a></div><div class="ttdeci">void apply(mets::feasible_solution &amp;s) const</div><div class="ttdoc">Virtual method that applies the move on a point</div><div class="ttdef"><b>Definition:</b> model.hh:404</div></div>
<div class="ttc" id="aclassmets_1_1swap__elements_html_a45079b62befcdaa317e3942ad1756960"><div class="ttname"><a href="classmets_1_1swap__elements.html#a45079b62befcdaa317e3942ad1756960">mets::swap_elements::hash</a></div><div class="ttdeci">size_t hash() const</div><div class="ttdoc">An hash function used by the tabu list (the hash value is used to insert the move in an hash set).</div><div class="ttdef"><b>Definition:</b> model.hh:416</div></div>
<div class="ttc" id="aclassmets_1_1swap__elements_html_a8bf3daa4735c34a3f0947ae186b18083"><div class="ttname"><a href="classmets_1_1swap__elements.html#a8bf3daa4735c34a3f0947ae186b18083">mets::swap_elements::clone</a></div><div class="ttdeci">clonable * clone() const</div><div class="ttdoc">Clones this move (so that the tabu list can store it)</div><div class="ttdef"><b>Definition:</b> model.hh:410</div></div>
<div class="ttc" id="aclassmets_1_1swap__elements_html_a9d045674248a1409743b3fa558391a6a"><div class="ttname"><a href="classmets_1_1swap__elements.html#a9d045674248a1409743b3fa558391a6a">mets::swap_elements::swap_elements</a></div><div class="ttdeci">swap_elements(int from, int to)</div><div class="ttdoc">A move that swaps from and to.</div><div class="ttdef"><b>Definition:</b> model.hh:391</div></div>
<div class="ttc" id="aclassmets_1_1swap__elements_html_abc881d41079ab026f69411a05db183e2"><div class="ttname"><a href="classmets_1_1swap__elements.html#abc881d41079ab026f69411a05db183e2">mets::swap_elements::evaluate</a></div><div class="ttdeci">gol_type evaluate(const mets::feasible_solution &amp;s) const</div><div class="ttdoc">Virtual method that applies the move on a point</div><div class="ttdef"><b>Definition:</b> model.hh:397</div></div>
<div class="ttc" id="aclassmets_1_1swap__elements_html_ad0b091837bf8081d2288a354b1cdb88e"><div class="ttname"><a href="classmets_1_1swap__elements.html#ad0b091837bf8081d2288a354b1cdb88e">mets::swap_elements::p1</a></div><div class="ttdeci">int p1</div><div class="ttdoc">the first element to swap</div><div class="ttdef"><b>Definition:</b> model.hh:429</div></div>
<div class="ttc" id="aclassmets_1_1swap__elements_html_ae6262642f3c5802d86fc2b4dc5d2ad6b"><div class="ttname"><a href="classmets_1_1swap__elements.html#ae6262642f3c5802d86fc2b4dc5d2ad6b">mets::swap_elements::operator==</a></div><div class="ttdeci">bool operator==(const mets::mana_move &amp;o) const</div><div class="ttdoc">Comparison operator used to tell if this move is equal to a move in the simple tabu list move set.</div><div class="ttdef"><b>Definition:</b> model.hh:732</div></div>
<div class="ttc" id="aclassmets_1_1swap__elements_html_af363135d28b4924d8b5efc48d7d2cffc"><div class="ttname"><a href="classmets_1_1swap__elements.html#af363135d28b4924d8b5efc48d7d2cffc">mets::swap_elements::p2</a></div><div class="ttdeci">int p2</div><div class="ttdoc">the second element to swap</div><div class="ttdef"><b>Definition:</b> model.hh:430</div></div>
<div class="ttc" id="aclassmets_1_1swap__full__neighborhood_html"><div class="ttname"><a href="classmets_1_1swap__full__neighborhood.html">mets::swap_full_neighborhood</a></div><div class="ttdoc">Generates a the full swap neighborhood.</div><div class="ttdef"><b>Definition:</b> model.hh:646</div></div>
<div class="ttc" id="aclassmets_1_1swap__full__neighborhood_html_a63ab451a42dc73a94e9081396afddd8e"><div class="ttname"><a href="classmets_1_1swap__full__neighborhood.html#a63ab451a42dc73a94e9081396afddd8e">mets::swap_full_neighborhood::refresh</a></div><div class="ttdeci">void refresh(mets::feasible_solution &amp;)</div><div class="ttdoc">Use the same set set of moves at each iteration.</div><div class="ttdef"><b>Definition:</b> model.hh:668</div></div>
<div class="ttc" id="aclassmets_1_1swap__full__neighborhood_html_a911f38a9ca80dab4bed155c5e463bc32"><div class="ttname"><a href="classmets_1_1swap__full__neighborhood.html#a911f38a9ca80dab4bed155c5e463bc32">mets::swap_full_neighborhood::~swap_full_neighborhood</a></div><div class="ttdeci">~swap_full_neighborhood()</div><div class="ttdoc">Dtor.</div><div class="ttdef"><b>Definition:</b> model.hh:661</div></div>
<div class="ttc" id="aclassmets_1_1swap__full__neighborhood_html_ab114139d615f8fa00fe092103eae0c1f"><div class="ttname"><a href="classmets_1_1swap__full__neighborhood.html#ab114139d615f8fa00fe092103eae0c1f">mets::swap_full_neighborhood::swap_full_neighborhood</a></div><div class="ttdeci">swap_full_neighborhood(int size)</div><div class="ttdoc">A neighborhood exploration strategy for mets::swap_elements.</div><div class="ttdef"><b>Definition:</b> model.hh:653</div></div>
<div class="ttc" id="aclassmets_1_1swap__neighborhood_html"><div class="ttname"><a href="classmets_1_1swap__neighborhood.html">mets::swap_neighborhood</a></div><div class="ttdoc">Generates a stochastic subset of the neighborhood.</div><div class="ttdef"><b>Definition:</b> model.hh:557</div></div>
<div class="ttc" id="agroup__model_html_ga36dfb89bf6fb84702f7d021426b3f039"><div class="ttname"><a href="group__model.html#ga36dfb89bf6fb84702f7d021426b3f039">mets::perturbate</a></div><div class="ttdeci">void perturbate(permutation_problem &amp;p, unsigned int n, random_generator &amp;rng)</div><div class="ttdoc">Perturbate a problem with n swap moves.</div><div class="ttdef"><b>Definition:</b> model.hh:281</div></div>
<div class="ttc" id="agroup__model_html_ga5bb7936b6ad1ff51e8574996f77d457f"><div class="ttname"><a href="group__model.html#ga5bb7936b6ad1ff51e8574996f77d457f">mets::swap_neighborhood::~swap_neighborhood</a></div><div class="ttdeci">~swap_neighborhood()</div><div class="ttdoc">Dtor.</div><div class="ttdef"><b>Definition:</b> model.hh:605</div></div>
<div class="ttc" id="agroup__model_html_ga9ece6da99a38121877de3e4f6c36293c"><div class="ttname"><a href="group__model.html#ga9ece6da99a38121877de3e4f6c36293c">mets::swap_neighborhood::refresh</a></div><div class="ttdeci">void refresh(mets::feasible_solution &amp;s)</div><div class="ttdoc">Selects a different set of moves at each iteration.</div><div class="ttdef"><b>Definition:</b> model.hh:614</div></div>
<div class="ttc" id="agroup__model_html_gacfbb156f3953666fe3ee538ceb770f65"><div class="ttname"><a href="group__model.html#gacfbb156f3953666fe3ee538ceb770f65">mets::random_shuffle</a></div><div class="ttdeci">void random_shuffle(permutation_problem &amp;p, random_generator &amp;rng)</div><div class="ttdoc">Shuffle a permutation problem (generates a random starting point).</div><div class="ttdef"><b>Definition:</b> model.hh:258</div></div>
<div class="ttc" id="agroup__model_html_gadf750e2f7c7ff73f7d3e3d9bedc3e417"><div class="ttname"><a href="group__model.html#gadf750e2f7c7ff73f7d3e3d9bedc3e417">mets::swap_neighborhood::swap_neighborhood</a></div><div class="ttdeci">swap_neighborhood(random_generator &amp;r, unsigned int moves)</div><div class="ttdoc">A neighborhood exploration strategy for mets::swap_elements.</div><div class="ttdef"><b>Definition:</b> model.hh:595</div></div>
<div class="ttc" id="astructmets_1_1dereferenced__equal__to_html"><div class="ttname"><a href="structmets_1_1dereferenced__equal__to.html">mets::dereferenced_equal_to</a></div><div class="ttdoc">Functor class to allow hash_set of moves (used by tabu list)</div><div class="ttdef"><b>Definition:</b> model.hh:712</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_5443dc39785d12144f0f708ef47f23c0.html">recognition</a></li><li class="navelem"><a class="el" href="dir_c58fa9eb52df620dd2c4bc6c0be0f1ed.html">include</a></li><li class="navelem"><a class="el" href="dir_506f4b5c21e68a1f0cdcd8f359404a1f.html">pcl</a></li><li class="navelem"><a class="el" href="dir_e84f9d06135eb4af4fdb57ef4c0340ad.html">recognition</a></li><li class="navelem"><a class="el" href="dir_762b04b8b4fe16ab038640e2130d7d01.html">3rdparty</a></li><li class="navelem"><a class="el" href="dir_00b605970e6349b77eee9dec2c429ff9.html">metslib</a></li><li class="navelem"><b>model.hh</b></li>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
